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

Product SKU on search results

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-16-2004, 05:00 PM
  CenturyPerf's Avatar 
CenturyPerf CenturyPerf is offline
 

eXpert
  
Join Date: Jun 2003
Location: Reno, Nevada
Posts: 396
 

Default Product SKU on search results

I have about half of this working, but it is just not pulling the Product Code. I've used this elsewhere and it is working fine. Just not on the search results page.

Code:
Product SKU: {$product[product].productcode}

I've entered the above into */customer/main/products.tpl* and I know I'm missing something, I just don't know what it is.

I've entered as below:

Code:
{* $Id: products.tpl,v 1.36 2003/11/11 14:02:37 svowl Exp $ *} {if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")} {include file="customer/main/products_t.tpl" products=$products} {else} {if $products} {section name=product loop=$products} <table border=0 width=100%> <tr><td width=90 align=center valign=top> <a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{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> </td> <td valign=top> {$products[product].product}</font> <font size=1> Product SKU: [b]{$product[product].productcode}</b {$products[product].descr|truncate:300:"...":true} </font>

Can someone advise me as to what I'm missing here?
__________________
Best Regards,

Sam Solace - Pres/CEO
Century Performance Center, Inc.
http://www.centuryperformance.com

(3) sites using X-Cart 5.3.5.5
X-Payments Enterprise 3.1.4
Reply With Quote
  #2  
Old 01-16-2004, 08:33 PM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

If that is the EXACT code you are using, you are missing an "s"

Product SKU: [b]{$product(HERE)[product].productcode}
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #3  
Old 01-16-2004, 09:57 PM
  CenturyPerf's Avatar 
CenturyPerf CenturyPerf is offline
 

eXpert
  
Join Date: Jun 2003
Location: Reno, Nevada
Posts: 396
 

Default

Adding an "s" makes no difference at all.

I have used that exact code
Code:
Product SKU: {$product[product].productcode}
in other places in the site. I personally have no use at all for the "productid" field, though I know X-Cart must have it. I cannot remember the corellation between 100,000 product ID's and their actual SKUs, but I can remember the SKUs.

I have so far been able to get rid of the "productid" and change it to the SKU in: Modify Products and other areas.

Anyone with another suggestion?
__________________
Best Regards,

Sam Solace - Pres/CEO
Century Performance Center, Inc.
http://www.centuryperformance.com

(3) sites using X-Cart 5.3.5.5
X-Payments Enterprise 3.1.4
Reply With Quote
  #4  
Old 01-16-2004, 10:17 PM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

Did you actually try it ? You see, the $products variable is being parsed from the php script itself, which outputs to smarty, there is no way the script will recognize an unpassed variable.

See it for yourself in /customer/products.php at the end of the script:
Code:
$smarty->assign("products",$products);

If it has been usefull in other parts, it is only because those other parts use a different variable assignation scheme (even if similar, but not the same, since 1 character makes a worlds difference).

Oh, and also close your bold tag properly, this could lead to other output damage on the design side.
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #5  
Old 01-16-2004, 11:42 PM
  CenturyPerf's Avatar 
CenturyPerf CenturyPerf is offline
 

eXpert
  
Join Date: Jun 2003
Location: Reno, Nevada
Posts: 396
 

Default

This is where it does NOT work: (you will see text above the thumbnail, but no product sku)
http://216.82.68.68/shop/customer/search.php?substring=

This is where it does work:
http://216.82.68.68/shop/customer/product.php?productid=16143&cat=0&page=1

In the example that works, I'm using:

Code:
Product SKU: {$product.productcode}

I've tried everything else I know of (and I'm just staring to learn PHP and Smarty) including:
  • Product SKU: {$products.productcode}
    Product SKU: {$product[product].productcode}
    Product SKU: {$products[product].productcode}

I also have it working (same as above) in place of ProductID on the Modify Products page in the admin section. You would think that if it works in 2 out of 3 spots, it should somehow work in the 3rd.
I'm sure this has to be something very simple
__________________
Best Regards,

Sam Solace - Pres/CEO
Century Performance Center, Inc.
http://www.centuryperformance.com

(3) sites using X-Cart 5.3.5.5
X-Payments Enterprise 3.1.4
Reply With Quote
  #6  
Old 01-17-2004, 12:04 AM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

Now I get the picture, should of seen your site earlier.

Guess what, you are editing the wrong file. It shows ok for your product details (products.tpl) but not your listed products.

Products are listed by category as well as search results with this file:
products_t.tpl
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #7  
Old 01-17-2004, 12:23 AM
  CenturyPerf's Avatar 
CenturyPerf CenturyPerf is offline
 

eXpert
  
Join Date: Jun 2003
Location: Reno, Nevada
Posts: 396
 

Default

Editing that file has made no difference. I've tried entering the code and it never shows up on the search results page. Are you sure you're looking at the correct link I gave in the previous post?
__________________
Best Regards,

Sam Solace - Pres/CEO
Century Performance Center, Inc.
http://www.centuryperformance.com

(3) sites using X-Cart 5.3.5.5
X-Payments Enterprise 3.1.4
Reply With Quote
  #8  
Old 01-17-2004, 01:03 AM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

Sorry, you're right, it is in products.tpl, but the code is:
Code:
{$products[product].productcode}
(notice the "s" as mentioned previously)

But I dont know why it wouldnt show. Im new to smarty as well, although I cannot find any logical reason for it not to show if you have entered it like that.

Im going to have a look at the php scripts as well, maybe its a query at the search engine that doesnt look for the productcode by default.

Note: just for the heck of it, could you try as above (without the product sku initial note and bold tags ?
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #9  
Old 01-17-2004, 01:36 AM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

Just verified it on my own site, works without any problem and just the way I mentioned on my first post, I really dont know what you are doing wrong, this is the code Im using:

Code:
<font size=1> Product SKU: {$products[product].productcode} {$products[product].descr|truncate:300:"...":true} </font>
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #10  
Old 01-17-2004, 10:03 AM
  CenturyPerf's Avatar 
CenturyPerf CenturyPerf is offline
 

eXpert
  
Join Date: Jun 2003
Location: Reno, Nevada
Posts: 396
 

Default

Maybe I just have some "cache bugs" or something. I tried it this morning the same way I did last night ... now it works.

I'm happy it is working, but curious as to why it decided not to work last night.

Thanks for the help Leon!
__________________
Best Regards,

Sam Solace - Pres/CEO
Century Performance Center, Inc.
http://www.centuryperformance.com

(3) sites using X-Cart 5.3.5.5
X-Payments Enterprise 3.1.4
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:37 PM.

   

 
X-Cart forums © 2001-2020