VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: bensonarchery on November 20, 2015, 03:24:27 AM

Title: Custom XML to push data into Virtuemart Database Help Multiple Priceing
Post by: bensonarchery on November 20, 2015, 03:24:27 AM
Hi,

We're running 2.0.16 which was the first release to incorporate multiple pricing for a product. I can get the grouping to work so shopper x sees price x and shopper y sees price y but the way our POS connects to our web server is all custom. We push an XML file to our web server and a php script will read the xml file and push the data into virtuemart.

A piece of code to initialize the $product class consist of:

$this->price=$Product->virtuemart->product_price;

How does this work with the new 2.0.16 structure? How do I push the second price? Is it an array $this->price=$Product->virtuemart->product_price[1];?

The same questions would apply for the following query:

$query4  = "UPDATE  ".$this->jmlPrefix."virtuemart_product_prices SET product_price='".$product->price."' WHERE virtuemart_product_id='".$this->virtuemart_product_id."'";

Any advice would be greatly appreciated.

Title: Re: Custom XML to push data into Virtuemart Database Help Multiple Priceing
Post by: GJC Web Design on November 20, 2015, 10:56:08 AM
2.0.16!!!!!!!!!!!  you must be joking..

2.6.22 is the current SAFE VM2 release..  anything else and your inviting hackers
Title: Re: Custom XML to push data into Virtuemart Database Help Multiple Priceing
Post by: bensonarchery on November 23, 2015, 01:22:27 AM
I am now running the latest VM2 release. What is the data structure like, how do I push multiple prices for a product and shopper groups?
Title: Re: Custom XML to push data into Virtuemart Database Help Multiple Priceing
Post by: GJC Web Design on November 23, 2015, 10:16:45 AM
easiest why is csvi...  it can handle xml imports .. and you can use it to export and see what is required for imports

look at #_virtuemart_product_prices  -- it is product id, shopper group id and price
Title: Re: Custom XML to push data into Virtuemart Database Help Multiple Priceing
Post by: bensonarchery on December 17, 2015, 02:08:06 AM
I'm having issues with my PHP script.

$this->wholesaler=$Product->PriceSchedule('xml:id', '1')->Price;

I have PriceSchedule as an attribute with id's 0, 1 and 2. I need to get the pricing from PriceSchedule id="1" and am using the above line in my script.

It doesn't work. Does anyone have any ideas?