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

Need help with html catalog mod to show sku in url.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-26-2005, 02:30 PM
 
isi isi is offline
 

Newbie
  
Join Date: Sep 2004
Posts: 4
 

Default Need help with html catalog mod to show sku in url.

When generating the html catalog, x-cart puts the x-cart product id in the title of the page (productname-p-122.html). I would like to put the sku (also known as "productcode") in the title instead since it's something people might actually search on (productname-p-112345). We use the manufacturer part number for the sku. I have been messing with html_catalog.php but can't figure it out. Anyone have an idea how to do this?

Thanks.

ISI
X-Cart Gold
4.0.13
Reply With Quote
  #2  
Old 07-26-2005, 05:09 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

I haven't tested this, so make a backup first:

In html_catalog.php, replace {productid} with {productcode} everywhere it appears. For example, you would replace this:

Code:
"product" => "{product_name}-p-{productid}.html",

with this:

Code:
"product" => "{product_name}-p-{productcode}.html",

Let me know if it works for you.....
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 07-27-2005, 12:23 PM
 
isi isi is offline
 

Newbie
  
Join Date: Sep 2004
Posts: 4
 

Default

Unfortunately that doesn't work and produces lots of sql errors.

If you replace just the line you showed, you get:

productname-p-{productcode}.html after generation.

Thanks though.

ISI
X-Cart Gold 4.0.13
Reply With Quote
  #4  
Old 07-27-2005, 12:25 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Dang, it was worth a shot at least
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 08-15-2005, 01:05 PM
 
isi isi is offline
 

Newbie
  
Join Date: Sep 2004
Posts: 4
 

Default

FWIW...

I worked around this problem by not using the x-cart html catalog feature at all. I bought the DSEFU mod (excellent by the way) and put the manufacturer's part number in the title of the product. My pages are now productname-manufacturerpart#-p-productid.html

ISI
X-Cart Gold 4.0.13
Reply With Quote
  #6  
Old 10-12-2005, 08:12 PM
  1CNS's Avatar 
1CNS 1CNS is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Los Angeles, CA, USA
Posts: 45
 

Default productid is an x-cart design flaw

I'm trying to deal with this same issue ... thanks for the tip on this mod. In your sample URL, both productcode and productid appear. Do you know if this mod allows you to specify a static URL that drops the productid alltogether?

The generation of productids and their central role in many aspects of X-Cart functioning is a basic design flaw that I keep hoping gets dumped in furture releases. In this instance, it's a problem because uploads can change the productid, and subsequently all of your static links suddenly become outdated if you regen the static HTML pages.

If you search posts in this forum you can find dozens of instances year after year where people want to use a user-defined product codes (SKU) and avoid having X-Cart assign a completely arbitrary code (productid) that can change with future uploads. The random and unstable nature of the productid is problem in a wide range of contexts, and the case for a substantial offsetting benefit for this architecture is very thin.
__________________
www.funkymart.com
x-cart 4.2.1 [linux]
Reply With Quote
  #7  
Old 10-12-2005, 08:18 PM
  1CNS's Avatar 
1CNS 1CNS is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Los Angeles, CA, USA
Posts: 45
 

Default P.S.

I was so busy ranting, I forgot to mention one more question:

I had tried the mod that balinor suggested above before finding this thread, and also found that productcode cannot be called from html_catalog.php. But that shouldn't be too tough, right? I don't really know smarty or php, but does someone who does know how this might be done? That would be the most direct fix for this.

Thanks in advance.
__________________
www.funkymart.com
x-cart 4.2.1 [linux]
Reply With Quote
  #8  
Old 10-13-2005, 02:02 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

you probably need to also call the product sku from the dataabse too and then add that to the part that creates the page

have a look in the code of admin/html_catalog.php
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #9  
Old 10-13-2005, 07:17 AM
  1CNS's Avatar 
1CNS 1CNS is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Los Angeles, CA, USA
Posts: 45
 

Default

Thanks for your reply. The mod I had originally tried without success was to find instances of:

Code:
"product" => "{product_name}-p-{productid}.html",

in html_catalog.php and change them to something like:

Code:
"product" => "{product_name}-p-{productcode}.html",

This doesn't work, so I was wondering how to call the productcode value in this script?[/code]
__________________
www.funkymart.com
x-cart 4.2.1 [linux]
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 08:13 AM.

   

 
X-Cart forums © 2001-2020