1. piekielko
  2. RO CSVI
  3. Friday, 12 May 2023
  4.  Subscribe via email
It is not possible to sort the order of price variants in a product.
If the price depends on the quantity of products added to the cart - "quantity range", the list of prices is always sorted according to this condition in order from the smallest to the largest.
The author of Virtuemart thought it was convenient and transparent and did so, but this is a serious mistake. Why?

if I want to export all products with prices using the RoCSVI component, the export will always display only the last price in the product list.
if I could manually sort these prices, there would be no problem - in the export I would display the last price that I set manually, not the one that the author of Virtuemart imposed on everyone


Is there any way to get around this problem?
Ideally, exporting prices in products should be the same as exporting images. Using the "Field Combine" rule and the foreach function, I would display the relevant price, not just the last one in the list.
Attachments (1)
Accepted Answer Pending Moderation
Hello Chris,
I tried to break product_price into a list of prices - same as images which are separated by "|" using the explode or foreach function. But I noticed that there is no such possibility, because the exported price is only one and the last one in the product list.

There is no such feature available so there is no possibility of exporting prices separated by | like we do for images.

Right now in XML I've made a trivial workaround for this. All "product_price" prices in each product (depending on the number of pieces) have the same value - on the store's website they change independently using rules. So when exporting I will always have the right base price.

Unfortunately, this solution blocks the possibility of creating additional discounts.

You can add the discounts in override file with custom coding like Roland mentioned.

In which file can I make such a modification?
plugins/csviaddon/virtuemart/com_virtuemart/model/export/product.php -> is this the right path?

Yes, that is the file to make modification. You can make the changes and set the file as override for export. Please check the document custom override export routine.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Rolandd,

If in Virtuemart it was possible to change the order of these rules for prices in the product, then there would be no problem. As for me, it's a bug, because I remember that it was possible before.

I tried to break product_price into a list of prices - same as images which are separated by "|" using the explode or foreach function. But I noticed that there is no such possibility, because the exported price is only one and the last one in the product list.

Right now in XML I've made a trivial workaround for this. All "product_price" prices in each product (depending on the number of pieces) have the same value - on the store's website they change independently using rules. So when exporting I will always have the right base price.

Unfortunately, this solution blocks the possibility of creating additional discounts.

In which file can I make such a modification?
plugins/csviaddon/virtuemart/com_virtuemart/model/export/product.php -> is this the right path?


Kind regards,
Chris
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,

First we need to realize that ordering products is not the same as ordering prices. It is a 1 to many relationship meaning that 1 product has many prices. Exporting the products has products as primary data and the prices are just joined data. The data is grouped by price, shopper group and currency. So the database compresses the data and the highest price will come out because that is stored last. Now what?

One thing you can try is to sort the output by product_price ascending or otherwise descending, this may bring out the lowest price first.

If that does not work the only other solution would be to code your own solution in a custom override export routine.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi,
In my shop, each product has a discount depending on the number of products added to the basket. these products in the XML file are additionally exported to external other stores that download the product with the basic price and other options such as images, description, etc. If the basic price in the export is olways the last one in the order that has a discount on the higher number of pieces of added products to cart, then such an export does not have any logic and sense...
If the price changes depending on the number of products added to the cart, the export price should always be taken from the lowest quantity range for the product in the cart.

The problem could be circumvented if in virtuemart these prices in the product could be sorted by setting the base price at the end. I don't understand the logic that this can't be done in Virtuemart and RoCSVI :(
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello,
It is not possible to sort the order of price variants in a product.
If the price depends on the quantity of products added to the cart - "quantity range", the list of prices is always sorted according to this condition in order from the smallest to the largest.
The author of Virtuemart thought it was convenient and transparent and did so, but this is a serious mistake. Why?

This is out of scope for us to answer as it is something related to VirtueMart code and not with RO CSVI code.

Is there any way to get around this problem?
Ideally, exporting prices in products should be the same as exporting images. Using the "Field Combine" rule and the foreach function, I would display the relevant price, not just the last one in the list.

You must be using VirtueMart Product export template and so you are seeing only one price value which is the last price of a product. To export multiple prices of a product use VirtueMart Price export template.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!