Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Change "buy now" links to forms.


dreamscape

Recommended Posts

  • 4 weeks later...

Yeah, the problem persists:

 

This mod works fine on MS1 v2.2, but not on MS2 v.2.2 >>

 

the problem is:

 

buy now buttons on Featured Products and Product Listing Pages do not add anything to the shopping cart.

 

Any help will be most appreciated.

 

Rgds

OTH

Link to comment
Share on other sites

standard SID killer with MS2 isn't much good I guess .. doesn't it rely on a pre defined set of IP addresses? And who knows how often the IPs of spiders would change. By the time you add IPs, the damage would have already been done.

 

Just my 2c

 

Yes, some official announcement must follow here.

 

PP

Link to comment
Share on other sites

  • 1 month later...
standard SID killer with MS2 isn't much good I guess .. doesn't it rely on a pre defined set of IP addresses? And who knows how often the IPs of spiders would change.  By the time you add IPs, the damage would have already been done.

PP

What's the answer regarding this mod? Should it be installed with MS2 and, if so, has anyone successfully modified the contribution to work with MS2? Thanks,

Stretchr

"It's a small world...

But I wouldn't want to paint it!"

Stephen Wright

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

I have master products installed and it changes the code in product_listing.php

 

instead of

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> ';
           break;

 

I have

case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
//Master Products            
           if ($listing['products_master_status'] != '1' && $listing['products_master'] == '0') {
           $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> ';
       } elseif ($listing['products_master'] != '0') {
           $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_master']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';       
       } else {
           $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> ';
       }	
//Master Products EOF       	 
           break;

 

Can all three of these statments be transformed without it breaking? If so, I can try to modify it or if someone could help me with the code I would appreciate it. :blink: I don't have the knowledge, but I can normally make things work given enough time. If someone could help me, thanks or at least tell me if it can be done.

 

 

Tim

Link to comment
Share on other sites

You know what, please no one waste their energy on this one yet. I seem to have another problem. My buy now buttons go to the shopping cart without adding the products. If I can't figure out how to solve this, I won't use the buy now buttons at all even though I like the idea.

 

 

Thanks anyway

 

Tim

Link to comment
Share on other sites

I have master products installed and it changes the code in product_listing.php

 

instead of

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> ';
? ? ? ? ? ?break;

 

I have

case 'PRODUCT_LIST_BUY_NOW':
? ? ? ? ? ?$lc_align = 'center';
//Master Products ? ? ? ? ? ?
? ? ? ? ? ?if ($listing['products_master_status'] != '1' && $listing['products_master'] == '0') {
? ? ? ? ? ?$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> ';
? ? ? ?} elseif ($listing['products_master'] != '0') {
? ? ? ? ? ?$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_master']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; ? ? ? 
? ? ? ?} else {
? ? ? ? ? ?$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> ';
? ? ? ?}	
//Master Products EOF ? ? ? ?	
? ? ? ? ? ?break;

 

Can all three of these statments be transformed without it breaking? If so, I can try to modify it or if someone could help me with the code I would appreciate it. :blink: I don't have the knowledge, but I can normally make things work given enough time. If someone could help me, thanks or at least tell me if it can be done.

 

 

Tim

Download the latest release of Master Products - the Add to Cart is not a link

 

Matti

Link to comment
Share on other sites

  • 4 weeks later...

best way in this case:

 

change:

 

if (isset($HTTP_GET_VARS['products_id'])) {

< if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

< tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

< } else {

< $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);

 

to

 

---

> case 'buy_now' : if (isset($HTTP_POST_VARS['products_id'])) {

> if (tep_has_product_attributes($HTTP_POST_VARS['products_id'])) {

> tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['products_id']));

> } else {

> $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity($HTTP_POST_VARS['products_id'])+1);

Link to comment
Share on other sites

  • 2 years later...

Hi All,

 

Please help me with this. I am completely stumped:

 

Code #1

 

<tr><td colspan=3 align=center><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image_button('small_view.gif', IMAGE_BUTTON_BUY_NOW) . '</a>?<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td></tr>

 

 

Code #2

<tr><td colspan=2 align=center><a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . tep_image_button('small_view.gif', IMAGE_BUTTON_BUY_NOW) . '</a>?<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_in_cart.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td></tr>

 

I need to convert both of the above codes to a form instead of a link. Please help me, I have been stumped for like 2 days trying to figure this out.

 

Appreciate all help and kindness,

StrictlyPC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...