News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Getting Product squ

Started by mkowalik, August 04, 2015, 13:22:19 PM

Previous topic - Next topic

mkowalik

Hello Everybody
   I have problem. I'm migrating 2 shops together. I have xml form one and i compare by product squ. I have function that works if I enter product squ in static for example "6"
But i need to do get product_squ when user click "add to cart" button. Down here is my code. If you could tell me what can get me product squ for compare it would be awesome.

I'm on version VirtueMart 2.6.18

Studio 42

Hi,

I think noone have understand your question ;)

Greets,
Patrick

mkowalik

Ok so I want to get product_sku and use it in function in 122 line of cart.php but I don't know how to get it. How to refer to product_sku of current product in cart.php??

Part of cart.php code

///////////////////
public function addJS() {
      
      
      $this->json = new stdClass();
      $cart = VirtueMartCart::getCart(false);
      if ($cart) {
         
      
                  
         $XMLQuery = new XMLQuery(6); // ,<--- here i want to return product_sku that was added to cart.
         
         if ($test=='true')

Studio 42

Hi,
First, most of time, you don't have to hack code, but use a plugin.
See YOURSITE\plugins\vmcustom\ for textinput code samples
or http://forum.virtuemart.net/index.php?topic=127362.0. and check code in function plgVmPrepareCartProduct
You can certainly use it(but you need to add the plugin in all product having to trigger the plugin).

Another solution is to use a joomla system plugin and check for requested view and function.

I don't know wat you have to check(validate product quantity, add info ...), then it's hard to give you the right answer