Jump to content

Displaying Quantity Discounts


peterp

Recommended Posts

Hi All,

         I'm using the skin 'eTrend' and what I'm trying to achieve on the homepage as well as the category page is the ability for the individual products to display a message stating that there are discounts available and if the user clicks this message they are taken to the product display which shows the quantity pricing table where they can then select their quantity for the order. I have tried testing for the Product.discounts id but I'm getting no where, it seems that at the point of displaying the product information on the homepage or the category page the quantity pricing table hasn't been accessed and therefore Product.discounts id is not set.

With my limited amount of knowledge I cannot see where the pricing.discounts table is accessed so therefore I'm unable to get this to work. Any help will be very appreciated.

Best Regards,

Peterp

Link to comment
Share on other sites

For much of the scenarios, CubeCart fetches only that data necessary for what was designed to show for each page. That is, everything for the View Product page, but not very much for the panels for the Homepage collection or the View Category (and Sales and Search results) collection.

Hopefully, we can find a hook in the "display homepage" and "display category" routines to incorporate code to fetch the (appropriate) quantity pricing schedule for all the products to be shown.

More later.

Link to comment
Share on other sites

Hi Brian,

             Thanks for that information, I was just thinking that maybe if we could access the pricing-quantity table for the products in the homepage and/or the category page. If the product is not found in this table then it won't have any quantity pricing and therefore the message of discounts will not need to display, if it does exist in this table then the discount pricing message will appear, if the user then clicks on this message it will be the same as the user clicking on the product for more info and this will show the quantity pricing table which they could order from as it is now, they would also have the ability at the homepage or category page to just order whatever they want without clicking the discount message or the product info. This is just my uneducated look at the issue.

Thanks for your help with this issue it is very much appreciated.

Best Regards,

Peterp

Link to comment
Share on other sites

Let's create a code snippet.

In admin, Manage Hooks, Code Snippets tab, click Add Snippet

When the page reloads, there will be a form below the existing list of snippets. Fill out the form as follows:

Enabled: checked
Unique ID: flgQuanDisc4Grp@CC62+
Execution Order: 1
Description: Adds a Quantity Discout bool for this Group ID to product data.
Trigger: class.cubecart.product_price
Version: 1.0
Author: https://forums.cubecart.com/topic/54924-displaying-quantity-discounts/
PHP Code:
<?php
$product_data['quant_pricing_avail'] = ($pricing)?true:false;

Save the snippet. (Probably need to clear the cache.)

Now, please know that CubeCart offers Customer Groups where a customer can belong to one or more groups and products can belong to one or more groups.

If a visitor is not logged in, it is Group_ID of 0 - typically named 'Retail'. Logged in, it is an array of Group_IDs. 'It' being the appropriate Quantity Discount Price charts for this product.

Simply, if there are quantity discounts for this product and the customer is eligible to benefit from it, there will be TRUE value that can be tested in the Smarty template code.

(Using Foundation as an example) Near line 43 of content.homepage.php:

Find:

            {* Remove comment if you want info button
            <a href="{$product.url}" title="{$product.name}" class="button tiny secondary left">{$LANG.common.info}</a>
            *}

Add these lines after that:

            {if $product.quant_pricing_avail}
            <a href="{$product.url}" title="{$product.name}" class="button tiny secondary left">QDP!</a>
            {/if}

What you can do with knowing that this product for this customer has Quantity Discount Pricing includes:
* a simple button
* a phrase
* an image corner ribbon (see product images in the CubeCart Marketplace)

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...