Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Display Quantity and price table

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-26-2009, 08:04 PM
 
rct rct is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 89
 

Default 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.
__________________
JOHN - v.5.3.X biz, X-payment 3.X
Reply With Quote
  #2  
Old 02-27-2009, 01:17 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default 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}
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #3  
Old 02-27-2009, 11:30 AM
 
rct rct is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 89
 

Default 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
__________________
JOHN - v.5.3.X biz, X-payment 3.X
Reply With Quote
  #4  
Old 03-02-2009, 12:29 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Display Quantity and price table

_product_wholesale is array,
so reverse() is a built-in javascript method for arrays
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #5  
Old 03-02-2009, 05:32 AM
 
rct rct is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 89
 

Thumbs up 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***
__________________
JOHN - v.5.3.X biz, X-payment 3.X
Reply With Quote
  #6  
Old 05-18-2009, 05:52 PM
 
rct rct is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 89
 

Default 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
__________________
JOHN - v.5.3.X biz, X-payment 3.X
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:21 AM.

   

 
X-Cart forums © 2001-2020