VirtueMart 1.1.x [ Old version - no longer supported ] > Products, Prices, Tax and Categories VM 1.1

Problem with Attributes not showing discounted prices.

(1/3) > >>

theredrobot:
All my products are discounted, and I want to display that to the customer.
This is fine for a product in category and product (flypage) view.
eg Product
was £100
now £50
save 50% - all great.

But most of the products have attributes (diff sizes) and when I add a price for the attribute, it is discounted by 50% at the checkout.
eg if I put in £200 in the back-end for an attribute, it displays £200 on the front-end but at checkout it's £100 (So the wrong price is being displayed).

Is there a way I can put in £200 in the backend, but it displays £100 in the front end (ie calculating the discount of 50%) and is also £100 at the checkout?

PRO:
for 1.0

but probably still relevant
http://forum.virtuemart.net/index.php?topic=22911.0

theredrobot:
Thanks - I found that earlier and had go, but didnt seem to work.
Theres an extra line of code now:

originally in 1.0 it was:

// Attributes for this item are done.
            // Now get item price
            if( $_SESSION['auth']['show_prices'] ) {
               $price = $ps_product->get_price($db->f("product_id"));
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate($db->f("product_id"));
                  $price['product_price'] *= $tax_rate;
               }
               $html .= ' - '.$CURRENCY_DISPLAY->getFullValue($price["product_price"]);
            }

Now in 1.1 its (extra line in bold):

   // Attributes for this item are done.
            // Now get item price
            if( $_SESSION['auth']['show_prices']) {
               $price = $ps_product->get_price( $db->f( "product_id" ) ) ;
               $price["product_price"] = $GLOBALS['CURRENCY']->convert( $price["product_price"], $price["product_currency"] ) ;
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate( $db->f( "product_id" ) ) ;
                  $price['product_price'] *= $tax_rate ;
               }
               $html .= ' - ' . $CURRENCY_DISPLAY->getFullValue( $price["product_price"] ) ;
            }

so I changed it to as suggested (in Bold):

   // Attributes for this item are done.
            // Now get item price
            if( $_SESSION['auth']['show_prices'] && _SHOW_PRICES ) {
               $price = $ps_product->get_adjusted_attribute_price( $db->f( "product_id" ) ) ;
               $price["product_price"] = $GLOBALS['CURRENCY']->convert( $price["product_price"], $price["product_currency"] ) ;
               if( $_SESSION["auth"]["show_price_including_tax"] == 1 ) {
                  $tax_rate = 1 + $ps_product->get_product_taxrate( $db->f( "product_id" ) ) ;
                  $price['product_price'] *= $tax_rate ;
               }
               $html .= ' - ' . $CURRENCY_DISPLAY->getFullValue( $price["product_price"] ) ;
            }

PRO:
I have not seen anyone else with this problem. I searched, and the above thread was all I found

theredrobot:
Looking at http://forum.virtuemart.net/index.php?topic=22911.0 more closely, I think the poster was refering to child products with different attribute, which is why I think the solution worked.

I'm trying to get the attributes of the product (no children) to display discount price.

Looking at the code in ps_product_attribute.php I cant see any formulas/code for displaying the discounted price for different attributes of a product.

Navigation

[0] Message Index

[#] Next page

Go to full version