Recent Posts

Pages: [1] 2 3 ... 10
1
General Questions / Re: Check for age
« Last post by jjk on Yesterday at 21:59:00 »
2
Product creation / Re: ajax - get virtuemart_product_id for product_sku
« Last post by sixlegs on Yesterday at 21:40:48 »
most of your code is bad. -  :'( I know, it started bad and then got worse...
If you use url: 'pendelsku.php' you are not in the Joomla framework so you cannot use JFactory::getDbo(); - I know, but I don't want to use pendel.sku.php - I'm looking for a better way

Joomla url are for eg. index.php?option=com_virtuemart&view=myview&sku=mysku
in this case com_virtuemart is the component, view is the view to call and sku is the sku you need to get informations.
Joomla doc to do ajax plugin here https://docs.joomla.org/Using_Joomla_Ajax_Interface if you dont need a component(for your sample a plugin is the simplest way)
But why using sku ?
sku is not mandatory and can have same value and can be changed. product ID is safe in any case.
To send to cart multiples products, you need to get all customfields, a hard task if you dont know Virtuemart and Joomla (and php)

My product consists of 5 parts each of them having multiple variants. product_sku characterizes these 5 components and is needed for assembly purposes.
Flipping through the variants helps you configure the product in no time and lets you see the product in a live preview.
It works up to the part where I need to get the virtuemart_product_id for my product_sku without page reload.

I'm quite sure it can be done very simply but I have no idea how.
Best for me would be a "copy-paste" solution as I have been working on the other details the whole weekend.
Bad thing if weekends are your only way to work focused on one single project...

@Studio42: Thanks for the Joomla Ajax Interface Link! I will check this as soon as I can
3
About VirtueMart / Re: Multilingual Virtuemart?
« Last post by jjk on Yesterday at 21:13:21 »
Perhaps check your Joomla and VirtueMart language configuration against this old tutorial (It was written for Joomla 2.5.x but it's still similar for Joomla 3.x). Or use Google to sear for virtuemart multi language to find newer tutorials.

Do you have the Joomla System - Language Filter enabled. Also you will need one Joomla language switcher module published for each language.
4
Administration & Configuration / Re: Please help with the email order
« Last post by LyuHr on Yesterday at 20:06:59 »
okay, if i understand right, first i need to do loop and get the product details  in mail_html_pricelist.php with

$model = VmModel::getModel('product');
$product = $model->getProductSingle($item->virtuemart_product_id,false);

and than how to show it in email order confirm in this file mail_html_vendor.php
5
About VirtueMart / Multilingual Virtuemart?
« Last post by Mister Paul on Yesterday at 18:25:05 »
Hi,

I have a VirtueMart 3.4.2 site.
It comes from a 10 years old site. So it has been migrated and all datas (Virtuemart included) has been imported.

Now I turn the new site in multilingual and I have in database for categories:
virtuemart_categories_en_gb
virtuemart_categories_fr_fr

I was logged backend with Franch language and could only see the French descriptions for Categories. I couldn't see where UK content was accessible...

Just to try... I logout and login back with UK language in the backend admin... and only at this time I could see Categories translated in English, and with their own English description text!
The Category ID is unique and has the same value for both language.

Is Virtuemart Multilingual system ruled like that?
Or is it my 10 years old multilingual site that "added" this feature during data importation?

Thanks for your help
Paul
6
Product creation / Re: ajax - get virtuemart_product_id for product_sku
« Last post by Studio 42 on Yesterday at 17:47:03 »
most of your code is bad.
If you use url: 'pendelsku.php' you are not in the Joomla framework so you cannot use JFactory::getDbo();

Joomla url are for eg. index.php?option=com_virtuemart&view=myview&sku=mysku
in this case com_virtuemart is the component, view is the view to call and sku is the sku you need to get informations.
Joomla doc to do ajax plugin here https://docs.joomla.org/Using_Joomla_Ajax_Interface if you dont need a component(for your sample a plugin is the simplest way)
But why using sku ?
sku is not mandatory and can have same value and can be changed. product ID is safe in any case.
To send to cart multiples products, you need to get all customfields, a hard task if you dont know Virtuemart and Joomla (and php)
7
General Questions / Check for age
« Last post by WERK70 on Yesterday at 17:17:23 »
When I users are recommended to enter their age, the datepicker only allows dates from now and the future. Obviously the script, that is calling datepicker has "minDate: -0". So datepicker behaves correctly. But that is not the intended function ;)

so I need to know, in which file the datepicker is called to change "minDate".

thx in advance
Frank
8
Product creation / ajax - get virtuemart_product_id for product_sku
« Last post by sixlegs on Yesterday at 12:55:29 »
Hi there,

maybe someone can helpme out of a problem.
I'm building a product configurator. It started simple - as always - and is getting more and more complicated as the project is speeding up - as always.

I have a variety of products that are combined by a graphical configurator. Just a few img-carousels that show the options in picture slides.
You build your product by flipping through the slides.

I read productIDs from the active slides and combine them to a product_sku that contains the complete product information like shape, colour, size, lightid and so on.
This is done by a few lines of jquery.

At the end I have a configured product and some accessories that I want to add to the cart by an "add multiple products"-link.
For the configured product that consists of 5 parts I'm trying to get the virtuemart_product_id by an ajax request and I'm completely stuck on this.

In my template I use
Code: [Select]
      function getvmid($psku) {
        $ldvmid  = 'SELECT `virtuemart_product_id` ';
        $ldvmid .=' FROM #__virtuemart_products ';
        $ldvmid .= 'WHERE ( `product_sku` = "'.$psku.'" )';
        $ldvmid .= ';';
        $ldvmidd = JFactory::getDbo();
        $ldvmidd->setQuery($ldvmfd);
        $vmproductid = $ldvmidd->loadResult();
        return $vmproductid;
      }

to get the virtuemart_product_id for my accessories.

My JQuery for the ajax stuff is like this - I know it's wrong:

Code: [Select]
// try to get vmid for skupendel where skupendel is the product_sku
      $ajax({
          type: 'GET',
          url: 'pendelsku.php',
          data: {skupendel:skupendel},
          success: function(data) {
            console.log(data);
          }
        })

pendelsku.php is nothing else than the function getvmid($psku) that I already used in my template. console.log(data) is there to show me the virtuemart_product_id for my product_sku

This drives me crazy. I never used ajax before but now I think I have to and I'm to stupid to understand...

Can't I just call my function, get the virtuemart_product_id and put it in my link to add my products to the cart?
All in one file without reloading the page?

Maybe you can help me on this one - in simple words please, as I'm really desperate  :'(

Greatings from sixlegs

Vm3.4.2 and J3.9.11







10
mail_html_pricelist.php

in the loop
Pages: [1] 2 3 ... 10