Hi all
Joomla 1.15
VM 1.015
lightbox mod (Mark Calif)
I have just finished changing the product flypage to recognise products that need to be sold by weight, and those that don't.
I've modified the shop.product_details.php and ps_product_attributes.php using two methods, to show quantity and price differently. I made it work up till now using both methods below. Please note that I'm not a php coder so the code could well be dodgy, but works so far. I'm just figuring it out as I go based on old, outdated programming experience.
1) in shop.product_details simply using: if ($flypage == flypage_byweight) (and, of course, the category flypage for these categories is set to shop.flypage_byweight
2) in ps_product_attribute using the following code: if ($product_weight > 1 and $product_weight_uom == 'grams') with these lines before:
$product_weight_uom = $ps_product->get_field( $product_id, "product_weight_uom");
$product_weight = round($ps_product->get_field( $product_id, "product_weight"));
Neither of the above methods work in basket_b2c.html.php, as far as I can tell. I understand this file has a different purpose, but I want to have a condition that will display the quantity as is, or multiplied by 100, and also to change the display to add the word 'grams' or not.
In natural langugae, something like....... if (product_unit = grams) then display the quantity entered multiplied by 100 and add the word 'grams'. If not, just display the entered quantity.
If anyone can help with this it would be really appreciated.
Here are two jpgs of the modified flypages for products sold by weight using two different methods (quantity entered as grams, or entered as hundreds of grams).
[attachment cleanup by admin]