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

Custom XML to push data into Virtuemart Database Help Multiple Priceing

Started by bensonarchery, November 20, 2015, 03:24:27 AM

Previous topic - Next topic

bensonarchery

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.


GJC Web Design

2.0.16!!!!!!!!!!!  you must be joking..

2.6.22 is the current SAFE VM2 release..  anything else and your inviting hackers
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

bensonarchery

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?

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

bensonarchery

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?