If this is your first visit, check our documentation. To post, register or login.

Product URL without Product ID?

Started by yourguide on 18 Aug 2011, 6:11 PM · Views: 1,369

Results 1 to 5 of 5
18 Aug 2011, 6:11 PM
#1
yourguide avatar

yourguide

New Zenner

Join Date:
Apr 2010
Posts:
10
Plugin Contributions:
0

Post #1 by yourguide

Heres the scoop... I have a product import that I wrote in PHP that runs daily to import my products from our accounting system.
The problem is I wrote it to just dump the products before it imports the new ones.... so everyday the product ID changes when new products are added. This is a problem because I cant link directly to a product using the Product ID... for like marketing and stuff.

Anyone know if there is a way to link to a product page without using the product ID? I have unique model numbers...
I really dont want to rewrite my import.
Thanks.

19 Aug 2011, 12:34 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

You need to rewrite your import ... because another side effect of what you've done is that search engines will never have accurate information due to your ever-changing links. Plus you'll eventually needlessly blow out the database with insanely large product ID numbers. Rewrite your import tool to match on model number and update instead of inserting.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Sep 2011, 2:32 AM
#3
yourguide avatar

yourguide

New Zenner

Join Date:
Apr 2010
Posts:
10
Plugin Contributions:
0

Post #3 by yourguide

:oops:
Good point on the search engines! Didn't see that one coming.
Though I don't have to worry about the insanely large Product ID's they start from 1 each day.

I just found out where to put code in the includes\modules\pages\product_info\header_php.php to use Model Number in the URL..... but I still have the other issue with the search engines....

I wonder, is there a way to change the product URL that is generated to use &products_model= instead of &products_id= ? in the advanced search results, since my menu is driven by them?
I am not using Categories like a regular zencart store.

Or am I clinging to a faulty design? :)

8 Sep 2011, 6:23 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #4 by gjh42

It sounds like you will need to rewrite either your import code to update instead of replace, or the core Zen Cart URL generator and everything that uses its output (and then maintain that rewrite through future ZC upgrades). Your choice...

10 Apr 2014, 8:14 PM
#5
osdparts avatar

osdparts

New Zenner

Join Date:
Nov 2012
Posts:
16
Plugin Contributions:
0

Post #5 by osdparts

yourguide:

:oops:
I just found out where to put code in the includes\modules\pages\product_info\header_php.php to use Model Number in the URL..... but I still have the other issue with the search engines....

I wonder, is there a way to change the product URL that is generated to use &products_model= instead of &products_id= ? in the advanced search results, since my menu is driven by them?

I know this is an old thread but applies to what I need to do. When people search for one of my parts by part number on Google, the search isn't doing as well as it could because my products part numbers aren't in my Zen URL. I searched through many posts and this one seemed like the closest to what I need to do. Can someone point me to the info I need for figuring out how to have part numbers included in the URL for my products?