Jump to content
Sign in to follow this  
dreamscape

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

I dont think you need them contributions on MS2, the admin side of MS2 now offers its own anti-SID killer for spiders...

 

maybe someone could correct this confussion.

Share this post


Link to post
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

Share this post


Link to post
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.

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites

Thanks Matti

 

Everything is working fine now. It seems the simplest solution is the best sometimes. :D

 

 

Tim

Share this post


Link to post
Share on other sites

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);

Share this post


Link to post
Share on other sites

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

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  

×