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

Quick help with Buy Now button pls.. page error!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-12-2006, 04:53 PM
 
instink instink is offline
 

Advanced Member
  
Join Date: Aug 2006
Posts: 44
 

Default 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!
__________________
X-cart 4.0.16
www.jctech.com.au
Reply With Quote
  #2  
Old 09-13-2006, 05:40 PM
 
instink instink is offline
 

Advanced Member
  
Join Date: Aug 2006
Posts: 44
 

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

Come one guys please... this should be an easy fix... someone? thanks!
__________________
X-cart 4.0.16
www.jctech.com.au
Reply With Quote
  #3  
Old 09-13-2006, 10:27 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default 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)
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #4  
Old 09-13-2006, 11:09 PM
 
instink instink is offline
 

Advanced Member
  
Join Date: Aug 2006
Posts: 44
 

Default 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!!!
__________________
X-cart 4.0.16
www.jctech.com.au
Reply With Quote
  #5  
Old 09-14-2006, 05:36 PM
 
instink instink is offline
 

Advanced Member
  
Join Date: Aug 2006
Posts: 44
 

Default 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!
__________________
X-cart 4.0.16
www.jctech.com.au
Reply With Quote
  #6  
Old 09-16-2006, 09:53 PM
 
instink instink is offline
 

Advanced Member
  
Join Date: Aug 2006
Posts: 44
 

Default 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?
__________________
X-cart 4.0.16
www.jctech.com.au
Reply With Quote
  #7  
Old 09-16-2006, 11:33 PM
 
tobychapman tobychapman is offline
 

Senior Member
  
Join Date: Sep 2005
Location: France
Posts: 112
 

Default 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}
__________________
XCart Gold 4.0.18
Fedora 6 - Apache 2.2.4 - PHP 5.1.6 - MySQL 5.0.27
www.goose.fr
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 02:31 PM.

   

 
X-Cart forums © 2001-2020