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)
-   -   Showing Accessories for Product(s) (https://forum.x-cart.com/showthread.php?t=17429)

eaglemobiles 01-30-2006 07:26 PM

That will be very gratefull if you could modify it.

Thanks

mukunig 03-01-2006 11:41 AM

I also would love to have this mod work so that the customer could select accessories using a checkbox and then move all of them to the checkout at once.

Thanks
Greg 4.0.13 heavily modified

anoack 03-01-2006 12:48 PM

Check boxes should be added but its going to require some extra coding. Right now im in the middle of a big project and can't exactly focus on getting check boxes added. If some one would like to work on getting this added or has already done a mod for it then please post it here.

Thanks,

QVS 03-08-2006 12:29 AM

any news on whether this could work on 4.14?

QVS 03-08-2006 09:59 AM

tried installing this and got this message:

Warning: mysql_connect(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/httpd/vhosts/qvsdirect.com/httpdocs/quickshop/templates_c/%%E5^E5B^E5BB4BE6%%subaccessphp.tpl.php on line 22
Could not connect to SQL db

anoack 03-09-2006 04:43 AM

QVS,
Make sure
Code:

global $sql_host, $sql_user, $sql_db, $sql_password;

is not commented out.
The error says it can't connect to the MySQL DB.
Try adding this on the last line to subaccessphp.tpl
Code:

echo "SQL Host: $sql_host";

Refresh the product page and tell me what it says under "SQL Host".

ShishaPipeUK 03-17-2006 09:11 AM

It worked fine on 4.0.18 xcart, you can see this at http://www.shisha.co.uk/shopcart/product.php?productid=16139&cat=265&page=1

I had to change the subaccessdiag.tpl to fit my own needs, the code is below:

Code:

{capture name=dialogacc}{section name=product loop=$products}{assign var="discount" value=0}
<TABLE border="0" width="100%">
  <TR>
    <TD width="90" align="center" valign="top"> {if $active_modules.Special_Offers ne "" and $products[product].have_offers} {include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]} {$lng.lbl_see_details} {else} {* THUMBNAIL *} <A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}">{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}

      {$lng.lbl_see_details}</A> {* NEW *} {* // 60 * 60 * 24 * 20 days in unix time = 1728000 *} {if ($products[product].add_date gt $smarty.now - 1728000) and ($products[product].add_date lt $smarty.now)} [img]{$ImagesDir}/mynew.gif[/img] {/if} {/if} {if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0 && $printable ne 'Y'}

     

      {include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid} {/if} </TD>
    <TD valign="top"> {* PRODUCT *} <FONT class="ProductTitle">{$products[product].product}</FONT>

      {* PRODUCT CODE SKU NUMBER*} {$lng.lbl_sku}: {$products[product].productcode} <FONT size="1">

     

      {* DESCRIPTION *} {$products[product].descr|truncate:300:"...":true}

      </FONT>
      <HR size="1" noshade width="100%" align="left">
      {if $products[product].product_type eq "C"} {include file="buttons/details.tpl" href="product.php?productid=`$products[product].productid`&cat=`$cat`&page=`$navigation_page`"} {else} {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {if $products[product].taxed_price ne 0} {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} {* PRICE *} <FONT class="MarketPrice">{$lng.lbl_market_price}: <S> {include file="currency.tpl" value=$products[product].list_price} </S></FONT>

      {/if} {/if} <FONT class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</FONT><FONT class="ConvertedProductPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</FONT>{if $discount gt 0}, {$lng.lbl_save_price} {$discount}%{/if} {if $products[product].taxes}

      <TABLE border="0">
        <TR>
          <TD>[img]{$ImagesDir}/spacer.gif[/img]</TD>
          <TD>{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}
        </TR>
      </TABLE>
      {/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 $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"} {include file="customer/main/buy_now.tpl" product=$products[product]} {/if} {/if} </TD>
  </TR>
</TABLE>
 


</p>{/section}
{/capture}
{include file="dialog.tpl" title="Accessories for $accprod" content=$smarty.capture.dialogacc extra="width=100%"}


Also the code for the product.tpl file, i had to move this, so it was under the product and not at the bottom like you mentioned in your post.

This code is showing the bottom part of my product.tpl file
Code:


{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount}
<SPAN id="save_percent">{ $discount }</SPAN>%
</TD></TR></TABLE>{/if}
</TD>
</TR>
<INPUT type="hidden" name="productid" value="{$product.productid}">
<INPUT type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}">
<INPUT type="hidden" name="page" value="{$smarty.get.page|escape:"html"}">
</FORM>
</TABLE>


 
{include file="subaccess/subaccessphp.tpl"}
{/capture}
{include file="dialog.tpl" title=$product.producttitle content=$smarty.capture.dialog extra="width=100%"}
{/if}



{include file="customer/main/send_to_friend.tpl" }
{if $active_modules.Detailed_Product_Images ne ""}



{include file="modules/Detailed_Product_Images/product_images.tpl" }
{/if}
{if $active_modules.Upselling_Products ne ""}



{include file="modules/Upselling_Products/related_products.tpl" }
{/if}
{if $active_modules.Recommended_Products ne ""}



{include file="modules/Recommended_Products/recommends.tpl" }
{/if}
{if $active_modules.Customer_Reviews ne ""}



{include file="modules/Customer_Reviews/vote_reviews.tpl" }
{/if}
{if $active_modules.Product_Options ne '' && $product_options ne ''}
<SCRIPT type="text/javascript" language="JavaScript 1.2">
check_options();
</SCRIPT>
{/if}


ShishaPipeUK 03-17-2006 09:19 AM

Just wanted to say that this is a very good mod, thank you for this.

It would be nice instead of using the mysql patch, there was a section in the admin area where the product is that you could enter in the cat number. But great mod, thanks.

ShishaPipeUK 03-22-2006 09:12 AM

Anock, like I said before this is a great mod.
I noticed that I have a lot of items in my accessories and the page scrolls down, so I wanted to put this in a 3 column format, so I changed the subaccessdiag.tpl file to show in 3 columns, below is my code.

The completed page you can see at http://www.shisha.co.uk/shopcart/product.php?productid=16137&cat=265&page=1

Code:

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

{ if %product.first% }
<table> 
{/if}

{if $smarty.section.product.index is div by 3}
</tr><tr valign="top">
{/if}

<TD width="90" align="center" valign="top"> {if $active_modules.Special_Offers ne "" and $products[product].have_offers} {include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]} {$lng.lbl_see_details} {else} {* THUMBNAIL *} <A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}">{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}

      {$lng.lbl_see_details}</A> {* NEW *} {* // 60 * 60 * 24 * 20 days in unix time = 1728000 *} {if ($products[product].add_date gt $smarty.now - 1728000) and ($products[product].add_date lt $smarty.now)} [img]{$ImagesDir}/mynew.gif[/img] {/if} {/if} {if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0 && $printable ne 'Y'}

     

      {include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid} {/if} </TD>
<TD valign="top"> {* PRODUCT *} <FONT class="ProductTitle">{$products[product].product}</FONT>

      {* PRODUCT CODE SKU NUMBER*} {$lng.lbl_sku}: {$products[product].productcode} <FONT size="1">

     

      {* DESCRIPTION *} {$products[product].descr|truncate:300:"...":true}

      </FONT>
      <HR size="1" noshade width="100%" align="left">
      {if $products[product].product_type eq "C"} {include file="buttons/details.tpl" href="product.php?productid=`$products[product].productid`&cat=`$cat`&page=`$navigation_page`"} {else} {if $active_modules.Subscriptions ne "" and $products[product].catalogprice} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {if $products[product].taxed_price ne 0} {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} {* PRICE *} <FONT class="MarketPrice">{$lng.lbl_market_price}: <S> {include file="currency.tpl" value=$products[product].list_price} </S></FONT>

      {/if} {/if} <FONT class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</FONT><FONT class="ConvertedProductPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</FONT>{if $discount gt 0}, {$lng.lbl_save_price} {$discount}%{/if} {if $products[product].taxes}

      <TABLE border="0">
        <TR>
          <TD>[img]{$ImagesDir}/spacer.gif[/img]</TD>
          <TD>{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}
        </TR>
      </TABLE>
      {/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 $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"} {include file="customer/main/buy_now.tpl" product=$products[product]} {/if} {/if} </TD>

{ if %product.last% }
</tr></table>
{/if}
 
{/section}
{/capture}
{include file="dialog.tpl" title="Accessories for $accprod" content=$smarty.capture.dialogacc extra="width=100%"}


All I did was to change the top part for the table and the bottom part:

Top Part:
Code:

{ if %product.first% }
<table> 
{/if}

{if $smarty.section.product.index is div by 3}
</tr><tr valign="top">
{/if}

<TD width="90" align="center" valign="top">


Bottom Part:
Code:

</TD>

{ if %product.last% }
</tr></table>
{/if}
 
{/section}
{/capture}
{include file="dialog.tpl" title="Accessories for $accprod" content=$smarty.capture.dialogacc extra="width=100%"}


I use this change on a few of my templates to make it a 3 column view.

You can also change this to a 2 column view by changing the {if $smarty.section.product.index is div by 3} to {if $smarty.section.product.index is div by 2}

anoack 03-28-2006 01:33 AM

ShishaPipeUK,
Great work! I am glad the mod is working out well for your site.

P.S. Great website! Too bad I don't live in the UK :D


All times are GMT -8. The time now is 05:18 PM.

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