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)
-   -   Quick help with Buy Now button pls.. page error! (https://forum.x-cart.com/showthread.php?t=24871)

instink 09-12-2006 04:53 PM

Quick help with Buy Now button pls.. page error!
 
Hi guys, there is a mod in the completed section for making the recommended products listing more intuitive. I am using it with some modifications on 4.0.16 and it looks great, like this:

http://www.jctech.com.au/images/related.jpg

The only problem is the Buy Now button doesn't work. IE gets an error that says:

Error: Object doesn't support this property or method

The entire code for my related_products.tpl is:

Code:

{* $Id: related_products.tpl,v 1.7.6.1 2004/07/15 10:28:54 svowl Exp $ *}

{if $product_links ne ""}
{capture name=dialog}
<table width="100%" border=0 cellpadding="0" cellspacing=0>
{section name=cat_num loop=$product_links}
<tr class="ItemsList">
  <td width="70" align=center valign=top>

{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=60}
  </td>
<td align=top valign=top> <table border=0 cellspacing=5 width="100%">
    <table>
      <tr valign="middle">
      <td align=top width="100%">
      <tr valign="middle">
      <td align=top>
<b>
<A href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>
{ $product_links[cat_num].product}
</A>        </b>        <br>{$product_links[cat_num].descr}
        {$lng.lbl_our_price}: {include file="currency.tpl" value=$product_links[cat_num].price}</font>
        <font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product_links[cat_num].price}</font>
      </b>
      </td>
<td align=right>
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" productid=$product_links[cat_num]}
{/if}
</td>
      </tr>
      <tr>   
      <td valign=top>
      </td>   
      <td colspan="3" align="right" valign=top>
        </td>
      </tr>
    </table>   
  </td></tr>
<tr class="ItemsList">
  <td colspan="5" align=center valign=top><hr></td>
  </tr>
{/section}
</table>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra="width=100%"}
{/if}


The problem is in this line:

Code:

{include file="customer/main/buy_now.tpl" productid=$product_links[cat_num]}


But for the life of me I can't figure out how to fix it... I have tried so many combinations of variants in that line its not funny, but I just cannot get it to work... PLEASE help, this should be a simple thing to do but I am a noob! thanks!

instink 09-13-2006 05:40 PM

Re: Quick help with Buy Now button pls.. page error!
 
Come one guys please... this should be an easy fix... someone? thanks!

inebriate 09-13-2006 10:27 PM

Re: Quick help with Buy Now button pls.. page error!
 
you are assigning the wrong object to productid...and going by products.tpl, you want product and not productid

you have:
{include file="customer/main/buy_now.tpl" productid=$product_links[cat_num]}

change to:
{include file="customer/main/buy_now.tpl" product=$product_links[cat_num]} //(if that doesnt work, try adding .product at the end, i dont know which to use)

instink 09-13-2006 11:09 PM

Re: Quick help with Buy Now button pls.. page error!
 
Hi mate, thanks for trying to help me. with your example, the button doesnt show up, instead it says "out of stock"

If I put .product on the end, the button shows, but when i click on it i get

Access denied !
You are not allowed to access that resource!

Error ID: 33

I tried browsing anonymous and logged in as a registered user.... any ideas? Thanks for trying to help!!!

instink 09-14-2006 05:36 PM

Re: Quick help with Buy Now button pls.. page error!
 
Please somebody? The method of listing a bunch of products with a buy now button works perfectly well in category display, why can't anyone get it working ni this format? its so similar I thiought...

I tried using some of the code from the products.tpl but it didn't work as I don't know anything about php... surely someone knows how to do it? thanks again!

instink 09-16-2006 09:53 PM

Re: Quick help with Buy Now button pls.. page error!
 
Pleeeease somebody???

I've seen this in so many xcart stores its not funny, yet no one can help me do it with mine?

please?

tobychapman 09-16-2006 11:33 PM

Re: Quick help with Buy Now button pls.. page error!
 
Quote:

Originally Posted by instink
Error: Object doesn't support this property or method


This is a form error. The buy_now template is probably not getting the variables it needs. Inebriate is right, buy_now needs a "$product" array, not a "$productid" array. So change as he suggests. Then make sure all the variables needed by buy_now are present. Put them all in another file and call this from the button and see which are present and which not. Check especially those needed by FORM in buy_now : _{$product.productid}_{$product.add_date}


All times are GMT -8. The time now is 06:20 PM.

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