MOD: smarter Quantity Discount table

This is a simple mod that adds a new start column to the Quantity Discount table. This column contains either “1+” or “[Minimum Quantity]+” depending on how the item is configured.



Replace the code in:

/skins/[yourskin]/basic/customer/views/products/components/product_qty_discounts.tpl



With:```php

{$lang.text_qty_discounts}:








{foreach from=$product.prices item="price"}

{/foreach}




{foreach from=$product.prices item="price"}

{/foreach}

{$lang.quantity} {if $product.min_qty > 0 }{$product.min_qty}{else}1{/if}+ {$price.lower_limit}+
{$lang.price} {include file="common_templates/price.tpl" value=$product.price} {include file="common_templates/price.tpl" value=$price.price}
```

Note: As seen in the attachment, the price displayed in the new column will reflect any Promotions. I'm trying to figure out a way to force it to the standard item price.

This was done in 2.0.4

cheers,
Glen

Picture 21.png

Thanks for this mod but there is already a feature on cscart versions

Really? How can I configure the stock 2.0.4 to perform as described above?

thanks,

Glen

Thank you for this Glen a very useful post.



Would you be able to offer any advice on how you could limit the data that is returned dependant on which group the customer is assigned?



We currently have our Qty Discounts as seen on screen shot



Best

Dean

Shop – Products - Administration panel_1265034920780.jpg

Hi Dean,



I just tested your pricing configuration with a sample product in 2.0.12 + my mod. Seems like everything works as expected. All pricing changes correctly when the user is registered or guest.



Glen

Is it possible for a registered member to see the membership quantity discount and non membership quantity discount so he could compare how much he saves with this membership?

[quote name=‘Darius’]Is it possible for a registered member to see the membership quantity discount and non membership quantity discount so he could compare how much he saves with this membership?[/QUOTE]



Nope. You’d need to do some tweaking to the PHP files for that.

I just wanted to clarify what’s happening and what I would like to see :wink:



When I assign user groups to the Qty Discount I would expect if a user assigned to that group signs into the website they would only see the qty discounts that relate to that group.



What I am seeing is one value from each of the lower limits.



Hope that makes sense

Qty_discount.jpg

[quote name=‘Dean’]only see the qty discounts that relate to that group.[/QUOTE]



Thats exactly what they will see. They can feel difference in prices only signing in and out.

Hi Darius



Thanks for your response.



They do see the change however if the different user groups have different quantity breaks then it fails.



A New Group user also sees part registered group. ie.



registered see qty breaks - 1, 2, 5

New Group see qty breaks - 1, 2, 5, 11, 36



Cheers

Dean,



In my 2.0.12 install, all price breaks / user groups in your example display correctly - except for Qty 1. This appears to be a bug. In my testing, Qty 1 price is fixed at the amount entered in the Admin/Products/General “Price” field regardless of Qty 1 pricing assigned to User Groups on the Admin/Products/Qty Discounts tab. I’ll submit a bug report now.



Worth noting: The cart doesn’t update a registered user’s User Group status until a logout/login has been performed. This caused some confusion while I was troubleshooting this.



Glen

Well, after posting the bug, I see that the Qty 1 price DOES display correctly in 2.0.12. This must have been fixed somewhere between 2.0.8 and the latest release.

Thank you for you posts.



I’m not sure if I explained myself but I have found a way to solve my problem.



My problem was this:

  1. I need to set a standard price that is seen by guests and resisted users.
  2. Registered users can be assigned to a special price group (many of these groups with different pricing and different price breaks)
  3. I need to import the Qty pricing (there is a lot of them)



    The problem occurs when a customer is assigned to a special price group as they can also see ‘registered’ users and ‘all’ price breaks (only if the price breaks differ)



    Also when importing the Qty pricing it appears that you cannot assign a price to guest or registered.





    The solution:

    Have two standard price groups - guest and a new group I have called customer

    I can assign the same qty price breaks for guest and customer and when a guest becomes a registered member they are by default assigned to the new customer group.



    This makes it easy to manage as I don’t need ‘All’ or ‘Registered’ group pricing.

    Any special price customers can be assigned to their relevant special price group and unassigned from the customer group.

    Works like a charm :o







    Example and setup:

    For this example it is assumed that the default usergroup is called ‘Customer’ with an usergroup_id of 8



    The reason for this is to ensure that Qty Discounts can easily be managed. Setup as follows:

    Assign the default Qty Discounts price of the products to Customer and Guest group (if you don’t want the user to see any difference when they register)

    Ensure that you set a price for qty 1 for each group

    Set the price under the general tab higher than any of you other prices ie if you product max price is £60 for one then set the general price to £1000 for example.



    Assign your Qty Discounts special prices to any group you wish to manage

    Again ensure that you set a price for qty 1 for each special group





    Now all your non registered and registered users see the same price however when you un-assign registered customers from the ‘Customer’ group and re-assign to a special price group the special priced customers see individual pricing depending on their group.





    The cide edit:



    The file is core/fn.users.php



    Find the line:


$auth = fn_fill_auth($user_data);



Change to:


$auth = fn_fill_auth($user_data);
}
}

// New code to add user to a default group
db_query("INSERT INTO ?:usergroup_links (status, user_id, usergroup_id) VALUES ('A', $user_id, '8')");
$auth = fn_fill_auth($user_data);






Thanks again to everyone who offered advice.



Cheers

Dean

Nice approach - I like your “automatic user group assignment” mod.

Hi,

Does it possible to have included tax quantity prices if country has tax?



In “products_qty_discounts.tpl”

What can i Change here ?



```php

{$lang.price}

{foreach from=$product.prices item=“price”}

{include file=“common_templates/price.tpl” value=$price.price}

{/foreach}

```

Best
Djuzapto

for 20% Tax I Changed:

value=$product.price



to

value=$product.price*1.2



John

Not a good solution, because if the customer is in a country without taxe, price will be with a taxe.

but… thank you

how many tax rates do you need to add?



I have added 2 rows one row with prices excluding tax and a row including tax



[ATTACH]2459[/ATTACH]



John

Dear,

Yes, this is it,JohnCarroll, thanks.



Have you got this code?



Best.

How can I change the font size and color in this section?