X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   EZUPSELL 3 column display (https://forum.x-cart.com/showthread.php?t=32790)

Art lopez 07-25-2007 02:17 PM

EZUPSELL 3 column display
 
I was wondering how to get a 3 column display for EZUPSELL. Currently it only shows up as a one column display. I'm a newbie when it comes to coding.

carpeperdiem 07-25-2007 04:45 PM

Re: EZUPSELL 3 column display
 
Ok -- let's look at how to do this -- a virgin ezupsell will have a loop that's just outside a <tr>

{section name=cat_num loop=$product_links}

then there is a {/section} outside the </tr> -- this basically asks how many product_links there are, and loops until they are done -- but since the loop is OUTSIDE the <tr> it will basically make a list, stackd on top of each other.

IF you were to put the loop just inside the <tr> before the <td>, and then move the {/section} to just before the </tr>, you will now loop <td> cells -- on the same line...

Now, the way I did this was to use some css and make an "ezupsell" lisitng class...so each product gets a thumbnail and a listing.

I would be happy to share my code - but you may want to ask Jon for a version that does what I am suggesting, since it is a commercial mod.

I hope this is enough to get you going here.

Jeremy

donavichi 03-22-2008 02:51 AM

Re: EZUPSELL 3 column display
 
Here's a 4.0 version of ezUpsell with a 4-column display. If you want to change the number of columns, change the '{ if %cat_num.index% is div by 4 }' to the number of columns that you require.

You get a thumbnail above the product title for each item.

Code:


{capture name=upsell}

<table border="0" align="center" cellpadding="2" cellspacing="0">
 <tr>
  <td valign="top"><div align="center">{include file="product_thumbnail.tpl" productid=$product_info.productid image_x=$config.Appearance.thumbnail_width product=$product_info.product tmbn_url=$product_info.tmbn_url}&nbsp;</div></td></tr>
  <tr>
  <td valign="top">
    <div align="center"><font size="3" face="Arial"><b>{$lng.lbl_you_have_added} {$amount} &quot;{$product_info.product}{if $amount > 1}s{/if}&quot; {$lng.lbl_to_your_shopping_cart}.</b></font>      <br />
    <font class="Text">What would you like to do now?</font></div></td>
 </tr>
</table>

<div align="center">
  <table border="0" cellspacing="0" cellpadding="0" width="411" height="43">
    <tr>
      <td width="195" height="43" background="{$ImagesDir}/ez_continueshopping.gif">
        <p align="center"><a href="home.php?cat={$product_info.categoryid}&page={$page}"><font color="#FFFFFF" size=2><b>{$lng.lbl_continue|upper}</b></font></a></td>
      <td width="216" height="43" background="{$ImagesDir}/ez_checkout.gif">
        <p align="center"><a href="cart.php"><font color="#FFFFFF" size=2><b>{$lng.lbl_checkout|upper}</b></font></a></td>
    </tr>
  </table>
</div>

<hr noshade size=1>

{if $product_links ne ""}
<p><font face="Arial" size="2"><b>These products go really well with {$product_info.product}:</b></font></p>


{section name=cat_num loop=$product_links}

{ if %cat_num.first% }
<table border=0 width="100%">{/if}
{ if %cat_num.index% is div by 4 }<tr>{/if}

<td style="padding-left:4px;padding-right:4px;padding-top:5px;padding-bottom:5px;" width="25%" align="center" valign="top"><a href="product.php?productid={ $product_links[cat_num].productid }">{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid product=$product_links[cat_num].product tmbn_url=$product_links[cat_num].tmbn_url}</a><br />
<a href="product.php?productid={ $product_links[cat_num].productid }">{ $product_links[cat_num].product|escape}</a></td>
{ if %cat_num.last% }</tr>
</table>{/if}
{/section}
{/if}
<br>
{/capture}

{include file="dialog.tpl" title=$lng.lbl_productadded content=$smarty.capture.upsell extra="width=100%"}


paul@dimoda.com.au 05-24-2008 07:04 AM

Re: EZUPSELL 3 column display
 
Does anyone have either, for 4.1, a 1 column display with product description or a multi column layout for version4.Thanks

Lingerieblowout 05-27-2008 06:22 AM

Re: EZUPSELL 3 column display
 
The above code works great in 4.1.9. for multi products.

Add this product to your cart for an example

http://www.lingerieblowout.com/EM-1987-Charmeuse-Gown-p-22510.html

SamsonWebDesign 11-05-2008 07:36 AM

Re: EZUPSELL 3 column display
 
Hi,

I have EZ Upsell installed and I want to add a buy now button to the page and also the short description.
Anyone know how this is done?

Jon 11-05-2008 07:58 AM

Re: EZUPSELL 3 column display
 
If on a recent x-cart version you can use:

Code:

{if $product_links ne ""}
<p><b>{$lng.lbl_with_this_product}:</b></p>
{include file="customer/main/products_t.tpl" products=$product_links}
{/if}


SamsonWebDesign 11-05-2008 08:05 AM

Re: EZUPSELL 3 column display
 
Quote:

Originally Posted by Jon
If on a recent x-cart version you can use:

Code:

{if $product_links ne ""}
<p><b>{$lng.lbl_with_this_product}:</b></p>
{include file="customer/main/products_t.tpl" products=$product_links}
{/if}



I just tried that but get an error back:
Warning: Division by zero in /shop/var/templates_c/%%29^29F^29F53FB4%%products_t.tpl.php on line 40
Warning: Division by zero in /shop/var/templates_c/%%29^29F^29F53FB4%%products_t.tpl.php on line 161

It does display the title, thumbnail and also the price which is good. I need a buy now button there though as well. Any ideas?

Jon 11-05-2008 08:07 AM

Re: EZUPSELL 3 column display
 
What is line 40 and 161 of your skin1/customer/main/products_t.tpl?

SamsonWebDesign 11-05-2008 08:09 AM

Re: EZUPSELL 3 column display
 
Quote:

Originally Posted by Jon
What is line 40 and 161 of your skin1/customer/main/products_t.tpl?


Well.....lines 39-42 are as follows:

{if $products[product].product_type ne "C"}
<br />
<br />
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}

The file ends at line 102!!!

Here it is in full
PHP Code:

{* $Idproducts_t.tpl,v 1.30.2.12 2008/07/15 12:07:40 ferz Exp $ *}
<
table width="100%" cellpadding="0" cellspacing="0">
<
tr>
    <
td>

<
table width="100%" cellpadding="5" cellspacing="1">

{
math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}

{
section name=product loop=$products}
{
assign var="discount" value=0}

{if %
product.indexis div by $config.Appearance.products_per_row}
<
tr>
{
assign var="cell_counter" value=0}
{/if}

{
math equation="x+1" x=$cell_counter assign="cell_counter" }

    <
td width="{$width}%" class="PListCell">

<
a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_page}class="ProductTitle">{$products[product].product}</a><br />
{if 
$config.Appearance.display_productcode_in_list eq "Y" and $products[product].productcode ne ""}
{
$lng.lbl_sku}: {$products[product].productcode}<br />
{/if}
<
table cellpadding="3" cellspacing="0" width="100%">
<
tr>
    <
td height="100" nowrap="nowrap">
<
a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_page}">{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$products[product].tmbn_x|default:$config.Appearance.thumbnail_width image_y=$products[product].tmbn_y product=$products[product].product tmbn_url=$products[product].tmbn_url}</a>
{if 
$active_modules.Special_Offers ne "" && $products[product].have_offers && $usertype eq 'C'}
{include 
file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{/if}
    </
td>
</
tr>
</
table>
{if 
$printable neq 'Y'}
<
a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_page}">{$lng.lbl_see_details}</a>
{/if}
{if 
$products[product].product_type ne "C"}
<
br />
<
br />
{if 
$active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include 
file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if (
$config.General.unlimited_products ne "Y" && ($products[product].avail le 0 or $products[product].avail lt $products[product].min_amount) && $products[product].variantid) or ($products[product].taxed_price ne 0 or ($products[product].variantid && $products[product].variants_has_price) or ($active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""))}
{if 
$products[product].taxed_price ne 0 or ($products[product].variantid && $products[product].variants_has_price)}
{if 
$products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{
math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if 
$discount gt 0}
&
nbsp;<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include 
file="currency.tpl" value=$products[product].list_price}
</
s></font><br />
{/if}
{/if}
<
font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</font><br /><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</font>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""},{/if} {$lng.lbl_save_price} {$discount}%{/if}
{if 
$products[product].taxes}<br />{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes is_subtax=true}{/if}
{/if}
{if 
$active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
{include 
file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]}
{/if}
{else}
<
font class="ProductPrice">{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{if 
$active_modules.Feature_Comparison ne '' && $products[product].fclassid 0}
<
div align="center" style="width: 100%; padding-top: 10px;">
{include 
file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}
</
div>
{/if}
{*** 
Uncomment it if you need 'Buy Now' button ***
{if 
$usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include 
file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
*** 
Uncomment it if you need 'Buy Now' button ***}
{/if}
    </
td>

{
capture name=prod_index}
{
math equation="index+x+1" index=%product.indexx=$config.Appearance.products_per_row}
{/
capture}
{if 
$smarty.capture.prod_index is div by $config.Appearance.products_per_row }
</
tr>
{/if}

{/
section}

{if 
$cell_counter lt $config.Appearance.products_per_row}
{
section name=rest_cells loop=$config.Appearance.products_per_row start=$cell_counter}
    <
td class="SectionBox">&nbsp;</td>
{/
section}
</
tr>
{/if}

</
table>
    </
td>
</
tr>
</
table>
{if 
$active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y' && $products_has_fclasses && $js_enabled}
{include 
file="modules/Feature_Comparison/compare_selected_button.tpl"}
{/if} 



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

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