Jump to content

Quantity Discount Price Is The Same For All Quantities


daxit_x

Recommended Posts

Hello

 

I am using the latest Prestashop release 1.6.1.4, successfully updated from 1.6.1, this problems were present already in the original installation 1.6.1

 

I searched pretty much about this problem and found some information, unfortunately partially focused and none that could help to solve my problem

 

I created group cart rules with conditions, a specific group can obtain a percentage discount depending on the quantity of one item.

 

So far all works fine, the discounts set as percentage and in the cart everything is working properly, discounted price is shown correctly, adding the items the price is updated according to the table of quantity discounts that was set in the BO.

 

E.g. the group of reseller buying 1 item in N categories get a X% discount, buying two pieces of the same item gets 2X% discount, buying 3 pieces of the same Item gets 3X% discounts etcetera....

 

The two problems I found are:

 

1) In the product page the table below the price that shows the new prices according to the quantities always the same original NOT discount price is shown in all rows, and the total saving is shown properly.

 

2) The new price is correctly shown in the upper part on the left, the old price is correctly shown as well just below, but adding items the new discounted price per item is NOT updated as it should

 

E.g.

A item which original price is 540€ is correctly shown to be discounted X% buying 1 piece, the label "instead of" shows correctly the original price, adding more items the new price corresponding to the discount for 2 pieces, or 3 pieces or N pieces is NOT shown.

 

Below in the table showing the savings in each row is shown the quantity of items to get the discount, the fuull original price instead of the discounted original price and finally the correct saved amount if buying N articles according to the discounts awarded.

 

To have visual idea of what happens please see the images:

 

post-440943-0-14631300-1454419057_thumb.jpg

post-440943-0-13855700-1454419058_thumb.jpg

post-440943-0-07298800-1454419059_thumb.jpg

post-440943-0-87831800-1454419187_thumb.jpg

 

I tried to look into product.tpl in the section quantity discount, but I could not understand what to do, I am just too ignorant to modify this code by myself without looking at working samples etcetera.

 

So far I tried to use the code from the default bootstrap, no changes what soever, exactly the same behaviour was observed, I tried to look into modifications done by other users but seems that actually there is none recent and no one worked for my case.

 

I just would like to have the new price updated if the client add an item and the correct discounted price per item in table below, this would be perfectly enough.

 

Here is the code from the quantity discount section in the product.tpl of my template ( I tried to substitute it with the default bootstrap template and apparently nothing changed, I reversed it before deeper test as anyway the problem was not solved and eventually other bugs could have been introduced in the template tpl file):

{if !$content_only}
{if (isset($quantity_discounts) && count($quantity_discounts) > 0)}
			<!-- quantity discount -->
			<section class="page-product-box">
				<h3 class="page-product-heading">{l s='Volume discounts'}</h3>
				<div id="quantityDiscount">
					<table class="std table-product-discounts">
						<thead>
							<tr>
								<th>{l s='Quantity'}</th>
								<th>{if $display_discount_price}{l s='Price'}{else}{l s='Discount'}{/if}</th>
								<th>{l s='You Save'}</th>
							</tr>
						</thead>
						<tbody>
						{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
							{if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
								{$realDiscountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
							{else}
								{$realDiscountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
							{/if}
							<tr id="quantityDiscount_{$quantity_discount.id_product_attribute}" class="quantityDiscount_{$quantity_discount.id_product_attribute}" data-real-discount-value="{convertPrice price = $realDiscountPrice}" data-discount-type="{$quantity_discount.reduction_type}" data-discount="{$quantity_discount.real_value|floatval}" data-discount-quantity="{$quantity_discount.quantity|intval}">

								<td>
									{$quantity_discount.quantity|intval}
								</td>

								<td>
									{if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
										{if $display_discount_price}
											{if $quantity_discount.reduction_tax == 0 && !$quantity_discount.price}
												{convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval}



											{else}
												{convertPrice price=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
											{/if}
										{else}
											{convertPrice price=$quantity_discount.real_value|floatval}
										{/if}
									{else}
										{if $display_discount_price}
											{if $quantity_discount.reduction_tax == 0}
												{convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval}



											{else}
												{convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
											{/if}






										{else}

											{$quantity_discount.real_value|floatval}%
										{/if}
									{/if}
								</td>
								<td>
									<span>{l s='Up to'}</span>
									{if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
										{$discountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
									{else}
										{$discountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
									{/if}
									{$discountPrice=$discountPrice * $quantity_discount.quantity}
									{$qtyProductPrice=$productPriceWithoutReduction|floatval * $quantity_discount.quantity}
									{convertPrice price=$qtyProductPrice - $discountPrice}
								</td>
							</tr>
						{/foreach}
						</tbody>
					</table>
				</div>
			</section>
		{/if}

Anyone have an idea on how to fix this simple problem? (not so simple for me obviously)?

Thank you in advance

 

Regards

D.

 

Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...