Jump to content

I want to display Original Price and the Customer Group Price


devo

Recommended Posts

Hi

Looking at the template file for GalaxyX skin product display - content.product.php, I see it uses {$PRODUCT.full_base_price} & {$PRODUCT.price_to_pay} to display the prices.

However, {$PRODUCT.full_base_price} is not displaying the original price.

We have a 'Trade' Customer Group and have assigned 'Trade' prices to our products, so when logged in as a Trade customer we expect that the original price AND the Trade prices are displayed but instead we just get the Trade price twice (the first is crossed out). Is this a bug?

Also, how can I test if a customer belongs to a particular group?

Many thanks in advance.

Link to comment
Share on other sites

"the first is crossed out"

The 'full_base_price' is the assigned price for that customer, however it was achieved, except being on sale:

* Customer Group Price
* Quantity Pricing
* Affected by Plugins (e.g., Category Discounts)

This price will be crossed out if a lower price can be achieved from being on sale, assuming the sale price is still lower than any of the above. The sale price then becomes the 'price_to_pay'. The 'price_to_pay' is also affected by any options chosen.

There was a mod to show MSRP/RRP prices, but the conversation about that mod has been removed from the cubecartforums.org forums.

Link to comment
Share on other sites

Hi, thanks for the quick response.

I managed to find the core file that processes the price... catalogue.class.php method getProductPrice, which I have modded to do what I want by storing the original price and passing that to the skin template, then modding the skin template. I dont like changing core files but there doesnt seem another way.

The correct prices seem to be passed to the cart and totals get calculated properly, so its looking ok so far.

We've 'updated' from cc4 to cc6 with a new skin and trying to replicate the original functionality -- getting there slowly. Sad how so many older modules have been discontinued (one that have not been incorporated into core, anyway).

May be back in touch if I get stuck again!

Link to comment
Share on other sites

In catalogue.class.php, near line 1124 in the getProductPrice() function, that statement is where custom code gets "hooked" into the core code.

However, in getProductPrice(), this function adjusts the entire pricing structure before the hook gets a chance to trigger.

So, we would need to find where the price gets acquired from the database query and use a hook as close to that as possible.

Unfortunately, in getProductData(), where all initial data is queried out of the database, the call to getProductPrice() happens before the hook triggers that will let us make sure the original price is added to the product details array.

Fortunately, $result, which holds the recordset of the query, remains undisturbed. So, the code in the hook can iterate across $result, adding the original 'price' into $data or $data[] as appropriate.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...