X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Display Quantity and price table (https://forum.x-cart.com/showthread.php?t=45870)

rct 02-26-2009 08:04 PM

Display Quantity and price table
 
I need some guidence, I am going to use 4.2x and I am trying to see if there's any way to display the price chart in an Ascending order. I would like it to show as follows:

Eg. 72+ $0.5
36+ $0.9
12+ $1.05

I tried to enter the price and quantity in the product mgt. in this sequence, but it will revert back to display 12+ on the 1st row, 36+ on 2nd row.

Any help will be much appreciated.

Victor D 02-27-2009 01:17 AM

Re: Display Quantity and price table
 
Whoa... wasted time to research that skin1/customer/products_prices.tpl actually does nothing since the working horse there is javascript.

Find in your skin1/modules/Product_Options/check_options.tpl lines
Code:

{if $product_wholesale ne ''}
{foreach from=$product_wholesale item=v key=k}
_product_wholesale[{$k}] = [{$v.quantity|default:0},{$v.next_quantity|default:0},{$v.taxed_price|default:$product.taxed_price}, [], {$v.price|default:$product.price}];
{if $v.taxes ne ''}
{foreach from=$v.taxes item=t key=kt}
_product_wholesale[{$k}][3][{$kt}] = {$t|default:0};
{/foreach}
{/if}
{/foreach}
{/if}



and change to
Code:

{if $product_wholesale ne ''}
{foreach from=$product_wholesale item=v key=k}
_product_wholesale[{$k}] = [{$v.quantity|default:0},{$v.next_quantity|default:0},{$v.taxed_price|default:$product.taxed_price}, [], {$v.price|default:$product.price}];
{if $v.taxes ne ''}
{foreach from=$v.taxes item=t key=kt}
_product_wholesale[{$k}][3][{$kt}] = {$t|default:0};
{/foreach}
{/if}
{/foreach}
_product_wholesale.reverse();
{/if}


rct 02-27-2009 11:30 AM

Re: Display Quantity and price table
 
Quote:

and change to
_product_wholesale.reverse();



Thanks for your input, since I am still testing my own site, there's no way to tell if it will work till the xcart team switch my version to v4.2. My original thought was also changing the tpl in skin1/customer/products_prices.tpl , but I didnt see anything. Anyways, you are the man!


Question, _product_wholesale.reverse() is this a built in function or I have missed something?

Thanks for your input!

Thanks

Victor D 03-02-2009 12:29 AM

Re: Display Quantity and price table
 
_product_wholesale is array,
so reverse() is a built-in javascript method for arrays

rct 03-02-2009 05:32 AM

Re: Display Quantity and price table
 
Gotcha, thanks for your input. Will let you know if it works after the final upgrade. ***cross my fingers***

rct 05-18-2009 05:52 PM

Re: Display Quantity and price table
 
Just want to Thank Victor for this soloution, finally got the 4.2 sorta running but the code works like a charm. Still more things to fix. Thanks Vic

Quote:

Originally Posted by Victor D
_product_wholesale is array,
so reverse() is a built-in javascript method for arrays



All times are GMT -8. The time now is 02:37 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.