Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Change buy now to url link


33 replies to this topic

#1 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 21:33

Is it possible to change the buy now button into a link to the product url instead of adding the item to the basket, it's easy to do it in product_info,

Trying to create a link directory, just seems to be this one stumbling block,

any help appreciated

Thanks

#2 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 21:36

Which buy now button do you mean? The one on the product_info.php page, or the one when you are browsing categories and all the products are displayed in rows in a table with a buy now button??

#3 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 21:40

the one when browsing categories used by /includes/modules/product_listing.php

Thanks

#4 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 21:44

Sure, search for the following in includes/modules/product_listing.php

case 'PRODUCT_LIST_BUY_NOW':
            $lc_align = 'center';
            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
            break;

and replace with

case 'PRODUCT_LIST_BUY_NOW':
            $lc_align = 'center';
            $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
            break;


#5 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 21:51

nah, that didn't work,

would it not have to go through redirect.php?

Thanks for the reply

#6 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 21:54

What exactly are you trying to do? The steps I just posted would have turned the buy now button when you are browsing for products in a category into a direct link to the product....

#7 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 21:54

sorry, i meant to the product link url, (external link to the manufacturer site about the product)

#8 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 21:55

So you want the buy_now button to go to the product_link for that product?

#9 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 21:57

yes

e.g. microsoft product and the buy now button goes to microsoft.com

#10 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 21:59

So for the specific product, you have it setup to for example, mirosoft, and in the manufacturer's admin area you added the microsoft web site, and you want the buy now button where it displays all the products to go directly to the manufacturer's web site of that product?

#11 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 22:03

no,

when adding a new product, theres a products url box,

i would like it when the buy now button is clicked it will go to the product url

#12 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 22:04

You are confusing the hell out of me :huh:

Do you have a site you can show me, and list the steps of what you mean...

#13 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 22:09

i'm trying to mod osc into a link directory, to external links

say i add a new product in admin e.g. fifa2004 pc game

i put in the product description etc..

then i come to the products url box and put the url to the game http://www.fifa2004.com

i would like it so that when you see the category view the buy-now button will go to the http://www.fifa2004.com page

(i've already got it to do this in the product_info page it's the just the product_listing one i can't do)

#14 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 22:12

Change the code from before to, see if this works

case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
           $lc_text = '<a href="' . $listing['products_url'] . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
           break;

Edited by rcmdesign, 29 July 2004, 22:12.


#15 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 22:15

it just links to my homepage :(

thanks for your help so far tho mate

#16 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 22:16

Do you have a link so I can see what's happening?

#17 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 22:17

http://www.kpweb.co.uk/index.php?cPath=1_4

(i want the link in the place of the current buy now slot, i'll change the buttom once the link works)

Edited by K-P, 29 July 2004, 22:21.


#18 rcmdesign

  • Community Member
  • 178 posts
  • Real Name:Rob

Posted 29 July 2004, 22:20

Well right now those products you sent me don't have a link on them. And do you want the name of the product to link to the site also, just like the buy now button. Or do you want to name of the product to go to the product_info.php like it does now...

P.S. There are a lot easier things to use in PHP than osCommerce for a site with just links..For example, http://www.phpnuke.org

Edited by rcmdesign, 29 July 2004, 22:21.


#19 K-P

  • Community Member
  • 31 posts
  • Real Name:Kev

Posted 29 July 2004, 22:22

http://www.kpweb.co.uk/product_info.php?cP...4&products_id=1

click reviews


i basically want the buy_now buttom in the category view to link externally link the review buttom does in product_info

Edited by K-P, 29 July 2004, 22:24.


#20 yesudo

  • Community Member
  • 3,376 posts
  • Real Name:Emmett Brosnan
  • Gender:Male
  • Location:London, England

Posted 29 July 2004, 22:22

is this affiliate based ? do you put your affiliate id in the link ?

what code are u using ?

the underlying link should call to the db to get the product home url.

Edited by yesudo, 29 July 2004, 22:23.

Your online success is Paramount.