Jump to content
Sign in to follow this  
gdfwilliams

All Products = Spider Food

Recommended Posts

here's a new one

 

$no_quotes_this_products_name = preg_replace("[x22]","",$no_underscore_this_products_name)

 

put this under the $no_underscore blah blah

Then change the one in the link.

 

I think this will get you started.

 

Let me know if it doesn't work

Share this post


Link to post
Share on other sites

I found converting names to something readable and usable in a link was something I wanted to place in many modules, so I created a function:

 

////

// returns name of product encoded for spidering

 function tep_spider_name($name) {

$name = str_replace(" ", "_", $name);

$name = str_replace("'", "", $name);

$name = str_replace(":", "", $name);

$name = str_replace(".", "", $name);



return $name;

}

 

then whereever you want the name converted you just do it like:

 

tep_spider_name($this_products_name)

 

where this_products_name is the products name for the module, ie $info_values['products_name']; $featured['products_name'}, etc...

 

you get the idea


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites

cgchris99, what do i change in the link?

do i change

rawurlencode($no_underscore_this_products_name)

to

rawurlencode($no_quotes_this_products_name)

*total guess* :?


________________________

 

FyersArt.com

________________________

Share this post


Link to post
Share on other sites

dreamscape, where would i place that piece of code? would i create a new php file in the function directory?

 

and with

tep_spider_name($this_products_name)

where exactly would i place that in a link?

sorry i'm quite new to php code :oops:


________________________

 

FyersArt.com

________________________

Share this post


Link to post
Share on other sites

oh, i've just noticed, if i click on any product from allprods.php, add to cart then click continue shopping, its comes up with item not found because the URL is http://www.fyersart.com/product_info.php/name////////... is anyone else aware of this problem?


________________________

 

FyersArt.com

________________________

Share this post


Link to post
Share on other sites

yes, you can click on an item but when you add it to cart, then click continue shopping this error comes up

 

put this under the $no_underscore blah blah  

Then change the one in the link.

can you tell me what i change in the link?


________________________

 

FyersArt.com

________________________

Share this post


Link to post
Share on other sites

cheers, thanks for all your help :D


________________________

 

FyersArt.com

________________________

Share this post


Link to post
Share on other sites
oh, i've just noticed, if i click on any product from allprods.php, add to cart then click continue shopping, its comes up with item not found because the URL is http://www.fyersart.com/product_info.php/n.../name////////... is anyone else aware of this problem?

 

I never thought of that. Does anyone know of a solution?

 

Jen


I haven't lost my mind - I have it backed up on disk somewhere.

Share this post


Link to post
Share on other sites

i dont show the cart after items are added and i dont have that problem - if i go to my allprods page, click an item, add the item to my cart, the item gets added and i remain on the page (turned off show cart in admin) - if i click on cart contents to show cart, the item is there and when i click continue shopping, everything is fine - you may want to do that for now until the cause of the problem is found :wink:


Reading is beneficial - Searching is enlightening

find answers at wiki.oscommerce.com/top

Share this post


Link to post
Share on other sites

I've been changing all my links per this wonderful mod and finally managed to figure out how to change category links. In categories.php, I changed this code around line 49 in my file:

 

after this line:

 

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);

 

change following block of code to this:

 

$no_underscore = str_replace(" ","_",$foo[$counter]['name']);

   $categories_string .= '<nobr><a nowrap href="';



   if ($foo[$counter]['parent'] == 0) {

      $cPath_new = 'category=' .str_replace("/", "/", rawurlencode($no_underscore)). '&cPath=' . $counter;

         

   } else {

       $cPath_new = 'category=' .str_replace("/", "/", rawurlencode($no_underscore)).'&cPath=' . $foo[$counter]['path'];

       

   }

 

I couldn't get the "/" replacement code to work on the one category where I had a slash, so I said 'screw it" changed it to "&" . Thanks to Greg for such a fantastic contribution!

 

Greg, any change to get the code to include the categories also ?

 

Maybe even manufacturers ?

Share this post


Link to post
Share on other sites

Hi Greg,

 

I've replaced many product links with this great suggestion & even managed to figure out how to change the categories box which I just posted here. However, I'm struggling with the main_categories.php page. I'm using your layout that you posted elsewhere for that page, but ir doesn't have the url encode stuff. Would you mind sharing that?

 

Thanks much!

 

Lee

 

To initiate globally, you'll have to touch every file that contains a product link.  As an example, let's look at the What's New infobox.

_name']). '&products_id=' . $random_product['products_id'])[/code]

 

Enjoy.

 

- Greg

Share this post


Link to post
Share on other sites

Man, you are good!

and dedicated, but the list still stops at

 

The distillers - gun

 

Ive seen its not because of the ( in the product name :?:

And also the continue button takes me to the main index page :?:

 

Anything you can think of?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×