X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Shop by Weight for x-cart 4.3.1 (https://forum.x-cart.com/showthread.php?t=52818)

ShishaPipeUK 03-14-2010 11:56 AM

Shop by Weight for x-cart 4.3.1
 
Below is the code for x-cart 4.3.1 to search for products using there weight value.

Place this in xcart/skin1/customer/shop_by_weight.tpl

Code:


{*
$Id: shop_by_weight.tpl,v 1.20 2009/04/23 11:35:03 max Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{capture name=weight}
<table width="100%"  border="0">
  <tr>
    <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_weight1">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[weight_min]" value="0.00">
<input type="hidden" name="posted_data[weight_max]" value="0.50">
<a class="VertMenuItems" href="javascript:document.productsearch_weight1.submit()" >Weight 0 - 0.50</a>
</form> </td>
    <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_weight2">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[weight_min]" value="0.50">
<input type="hidden" name="posted_data[weight_max]" value="1.00">
<a class="VertMenuItems" href="javascript:document.productsearch_weight2.submit()" >Weight 0.50 - 1</a>
</form> </td>
  </tr>
 
  <tr>
    <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_weight3">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[weight_min]" value="1.00">
<input type="hidden" name="posted_data[weight_max]" value="1.50">
<a class="VertMenuItems" href="javascript:document.productsearch_weight3.submit()" >Weight 1 - 1.50</a>
</form> </td>
    <td><form style="margin-top: 0; margin-bottom: 0" method="POST" action="search.php" name="productsearch_weight4">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="posted_data[weight_min]" value="1.50">
<input type="hidden" name="posted_data[weight_max]" value="999.99">
<a class="VertMenuItems" href="javascript:document.productsearch_weight4.submit()" >Weight 1.50 +</a>
</form> </td>
  </tr>
</table>
{/capture}
{include file="customer/menu_dialog.tpl" title=$lng.lbl_Shop_by_weight content=$smarty.capture.weight additional_class="menu-bestsellers"}


Once uploaded you can change your xcart/skin1/customer/home.tpl by adding the code below.

Code:


{include file="customer/shop_by_weight.tpl"}


cautious 03-14-2010 01:47 PM

Re: Shop by Weight for x-cart 4.3.1
 
Good work ShishaPipeUK. Just a trend question: Are there many instances of buyers searching by weight? One would envisage that the weight of supplies or accessories that customers are looking for would not matter as much as the prices. Right?

ShishaPipeUK 03-14-2010 02:10 PM

Re: Shop by Weight for x-cart 4.3.1
 
Yes i would agree with you, even my online shops do not use the weight mod.

I would suspect the weight is more for a shop that does not use the weight for shipping calculation but maybe for a product, for example selling fitness equipment (weights).

Or maybe a product that is the same but different weights for different prices, for example fruit, or sweets.

I just thought i would post this as well as the shop_by_price.tpl

I am working on shop_by_size.tpl where in product options you have the size of the dress, but having a few problems with this one. You can see
http://forum.x-cart.com/showthread.php?t=52804 for more info.


All times are GMT -8. The time now is 02:51 AM.

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