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)
-   -   Need help with html catalog mod to show sku in url. (https://forum.x-cart.com/showthread.php?t=15470)

isi 07-26-2005 02:30 PM

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

balinor 07-26-2005 05:09 PM

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.....

isi 07-27-2005 12:23 PM

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

balinor 07-27-2005 12:25 PM

Dang, it was worth a shot at least :(

isi 08-15-2005 01:05 PM

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

1CNS 10-12-2005 08:12 PM

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.

1CNS 10-12-2005 08:18 PM

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.

shan 10-13-2005 02:02 AM

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

1CNS 10-13-2005 07:17 AM

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]


All times are GMT -8. The time now is 09:21 PM.

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