Zen Cart Logo
Forums / All Other Contributions/Addons / Buy now button in main page products

Buy now button in main page products

Views: 8,836

Results 1 to 20 of 29
14 Oct 2009, 2:33 AM
#1
soki avatar

soki

New Zenner

Join Date:
Apr 2008
Location:
Athens
Posts:
85
Plugin Contributions:
0

Buy now button in main page products

This thread will be the support thread for a new contribution/add on I make for adding a buy now button in main page products listing (New Products, Featured Products, Specials Products, etc...).

Instructions here: http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=1440

You can see the add on in action on my web site http://www.easytechnology.gr/index.php?main_page=index&language=en

14 Oct 2009, 4:02 PM
#2
g_force avatar

g_force

Zen Follower

Join Date:
Feb 2009
Posts:
354
Plugin Contributions:
0

Re: Buy now button in main page products

haven't tested this yet but does it enable users to purchase a product directly rather than with any other items that may be in the shopping cart?

_thanks

14 Oct 2009, 6:20 PM
#3
soki avatar

soki

New Zenner

Join Date:
Apr 2008
Location:
Athens
Posts:
85
Plugin Contributions:
0

Re: Buy now button in main page products

Add the product to shopping cart, if have more products in cart will not change them.

11 Nov 2009, 2:34 PM
#4
mcarbone avatar

mcarbone

Zen Follower

Join Date:
Feb 2009
Location:
Simi Valley, CA
Posts:
99
Plugin Contributions:
0

Re: Buy now button in main page products

Sweet Contribution...just what I was looking for. But can I position the button on the side of the image. I've been cssing for 42 hours straight and know it's somewhere...but if you have a shortcut, that would be amazing.

https://www.vapur.us/shop

I also wanted to display part of the description (like the specs of the product and attributes). I'll look into this and will hopefully have some feedback.

Thank you,

Michelle Carbone

14 Nov 2009, 7:09 PM
#5
nyczhenry avatar

nyczhenry

New Zenner

Join Date:
Nov 2007
Posts:
15
Plugin Contributions:
0

Re: Buy now button in main page products

does this work with cross sell/xsell? or how can i make it work with this?
thanks

19 Nov 2009, 7:08 AM
#6
soki avatar

soki

New Zenner

Join Date:
Apr 2008
Location:
Athens
Posts:
85
Plugin Contributions:
0

Re: Buy now button in main page products

mcarbone:

Sweet Contribution...just what I was looking for. But can I position the button on the side of the image. I've been cssing for 42 hours straight and know it's somewhere...but if you have a shortcut, that would be amazing.

https://www.vapur.us/shop

I also wanted to display part of the description (like the specs of the product and attributes). I'll look into this and will hopefully have some feedback.

Thank you,

Michelle Carbone

As I mention in the contribution is an extension to this original thread http://www.zen-cart.com/forum/showthread.php?t=123392 , he uses css and product description but i have not include those to my contribution to make it simplier for users to install it. So please take a look in the thread http://www.zen-cart.com/forum/showthread.php?t=123392

Hope you good luck

19 Nov 2009, 7:11 AM
#7
soki avatar

soki

New Zenner

Join Date:
Apr 2008
Location:
Athens
Posts:
85
Plugin Contributions:
0

Re: Buy now button in main page products

nyczhenry:

does this work with cross sell/xsell? or how can i make it work with this?
thanks

This contribution is for the main page products displayed there for other sections in zencart need to modify the files

17 Dec 2009, 3:54 AM
#8
nyzcaddict avatar

nyzcaddict

New Zenner

Join Date:
Dec 2009
Posts:
17
Plugin Contributions:
0

Re: Buy now button in main page products

i would also be interested in an add now button for my cross sell items. does anyone know how to do this?
thanks

9 Mar 2010, 8:44 PM
#9
jellygraphics avatar

jellygraphics

New Zenner

Join Date:
Mar 2010
Posts:
5
Plugin Contributions:
0

Re: Buy now button in main page products

Hi

I'm trying to add this to my shop - when I do so, I get the button as required, however the whole grid of the site falls apart! It's like the containing frame isn't big enough to hold the extra Buy Now Button...

Does anyone else have this or better yet any advice on how to fix??!

Thanks

Pete

15 Mar 2010, 9:47 PM
#10
sokiaoki avatar

sokiaoki

New Zenner

Join Date:
Sep 2008
Posts:
1
Plugin Contributions:
0

Re: Buy now button in main page products

jellygraphics:

Hi

I'm trying to add this to my shop - when I do so, I get the button as required, however the whole grid of the site falls apart! It's like the containing frame isn't big enough to hold the extra Buy Now Button...

Does anyone else have this or better yet any advice on how to fix??!

Thanks

Pete

If you use some other contribution that modifies the main page may need to do some changes. For example I use also the column divider add on and have problems because some products had false product id, for example the real product id was 750 and when I clicked the buy now button in main page the product id was 71000.
I manage to overcome that by deleting this 2 lines
$r_params = str_replace("50", "100", $r_params);
$r_params = str_replace("33", "100", $r_params);

in includes/templaters/YOUR TEMPLATE/common/tpl_columnar_display.php

Please check if something similar happens to you with some other add on.

:smile:

11 Apr 2010, 4:26 PM
#11
sw09 avatar

sw09

New Zenner

Join Date:
Mar 2010
Posts:
8
Plugin Contributions:
0

Re: Buy now button in main page products

jellygraphics:

Hi

I'm trying to add this to my shop - when I do so, I get the button as required, however the whole grid of the site falls apart! It's like the containing frame isn't big enough to hold the extra Buy Now Button...

Does anyone else have this or better yet any advice on how to fix??!

Thanks

Pete

Are you using column grid? I have the same problem. All the grid seems fall apart. But I manage to find the solution to this. Compare the two code before and after replace. Take out the product description code. Replace the class with the original class then wa la! Looks great!:clap:

1 Jun 2010, 11:33 AM
#12
wheat avatar

wheat

New Zenner

Join Date:
Oct 2006
Posts:
62
Plugin Contributions:
0

Re: Buy now button in main page products

I have received several messages asking how I was able to get the mod offered by SOKI to work.

The answer is I did not, however, it seemed worth a try to look closely at the one he used as a starting point:
http://www.zen-cart.com/forum/showthread.php?t=123392

My explanation of the almost too easy solution for using it with NEW as well as FEATURED products is in this message:
http://www.zen-cart.com/forum/showpost.php?p=891374&postcount=27

If you view the result at:
http://itsalljuststring.biz/

I did go on to modify some of the HTML to get the appearance I preferred.

It is not perfect, and there does seem to be an intermittent bug where the main page is not displaying on the first try, I am suspecting that is a different problem, because it is also occurring in my old site where this mod has not been applied.
http://www.ItsAllJustString.com

My thanks to SOKI because while I like what he did, it seem to conflict with other mods that were important to me and since he included the link to Dharam, I was able to "follow the directions" and accomplish "phase 1 AND 2"

HTE

Wheat

2 Jul 2010, 8:08 AM
#13
scanhead avatar

scanhead

New Zenner

Join Date:
Mar 2010
Posts:
3
Plugin Contributions:
0

Re: Buy now button in main page products

sw09:

Are you using column grid? I have the same problem. All the grid seems fall apart. But I manage to find the solution to this. Compare the two code before and after replace. Take out the product description code. Replace the class with the original class then wa la! Looks great!:clap:

Can you post the script changes you made?

Its for my first site and i just want the buy now button to show on the New products main page.

https://www.scanhead.co.nz

Thanks

28 Jan 2011, 10:54 PM
#14
redbaron2 avatar

redbaron2

New Zenner

Join Date:
Dec 2010
Posts:
16
Plugin Contributions:
0

Re: Buy now button in main page products

Well this thread seems to be a little dated, but in installing this contribution. I ended up making my own edits that might be of value to others that come across this thread in the future.

I have learned in making edits to the Zen Cart (ZC) files simple is best.
I first started with making this addition to the Custom_Template/english.php

// Buy Now Link in Specials, New, and Featured Products listings
  $specials_buy_now_link = false; // Change this to true to show  Buy Now in Specials Products listings
  $new_buy_now_link = false; // Change this to true to show  Buy Now in New Products listings
  $featured_buy_now_link = false; // Change this to true to show Buy Now in Featured Products listings

This is a global file for ZC which is loaded quite often. If I knew how to make the changes for globals to the Admin section. This edit would not be needed (any help would be appreciated)

Caution: remember to save the new specials_index.php file to the Custom_Template directory under Modules
Second since the Original Contribution required another contribution to be used in conjunction, and had the side effect of breaking the box (div's for the products). I knew I had to change the Mod to work for my site. This was done by editing the code for the specials_index.php after finding this line ```php
while (!$specials_index->EOF) {

We added these lines just below that line```php
	if ($specials_buy_now_link == true) {
	$buy_now_link = zen_get_buy_now_button($specials_index->fields['products_id'],'<br/> <br /><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $specials_index->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) .'</a>');
	} else {
	$buy_now_link = '';
	} 

This edit to the file makes sure that if you don't like the mod you can change back to the old way just by editing the english.php file earlier. I first off wanted the "Buy Now" to be below the ZC price. You then look for line in specials like this```php
. '</a><br />' . $products_price);

You will be changing it to be this```php
. '</a><br />' . $products_price . $buy_now_link);

I proceeded to make these changes to the featured and new products php files. Remembering to put in the if statement for old fall back in case I decided the mod wasn't what I wanted. If anyone would like more detail for the edit I did just use the forum to contact me.

Red Baron

4 Feb 2011, 12:59 PM
#15
darkmarauder avatar

darkmarauder

New Zenner

Join Date:
Feb 2010
Location:
Northants, England
Posts:
83
Plugin Contributions:
0

Re: Buy now button in main page products

I just installed this on to my test shop, without any errors.
I modified the code for /includes/modules/new_products.php and /includes/modules/featured_products.php and neither page has changed at all.
I did the normal thing of closing down the browser and clearing all temporary files, but this did not make any difference.

Any help please?

6 Feb 2011, 9:34 AM
#16
redbaron2 avatar

redbaron2

New Zenner

Join Date:
Dec 2010
Posts:
16
Plugin Contributions:
0

Re: Buy now button in main page products

darkmarauder:

...
I modified the code for /includes/modules/new_products.php and /includes/modules/featured_products.php and neither page has changed at all.
...
Any help please?
Let me point out the error here. "neither page has changed at all"
The pages for the specials, featured, and new products pages do not change at all. This mod makes changes to these boxes on the main page only. If these are selected in the admin. These boxes are not selected by default in a standard ZC install. I hope this helps.

16 Jul 2011, 11:26 AM
#17
vimad avatar

vimad

New Zenner

Join Date:
Oct 2010
Posts:
20
Plugin Contributions:
0

Re: Buy now button in main page products

Hi all!

I have installed this module for featured products and new products.

It works perfectly with featured products, but something does not work with new products when a product is sold out...

In the case of new products, when an item is sold out it shows the sold out image and after it a > sign; besides, it does not apply the <br/> and there is no space between the image and the product image.

I do not know if the explanation is clear... I hope so.

The website is: https://www.abedulart.com

Just refresh until a sold out product appears and you will see what I mean.

Any help?

Thanks!!

9 Aug 2011, 11:45 PM
#18
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: Buy now button in main page products

I have the same problem with the ">" appearing in the case of a sold out item.

Any Ideas?

Thank you
Drunkguy

11 Sep 2011, 3:03 PM
#19
urkos avatar

urkos

New Zenner

Join Date:
Aug 2009
Posts:
29
Plugin Contributions:
0

Re: Buy now button in main page products

When i use the buy it now options it now puts everything out of line. eg i get

buy it now button1

Image1 ............................. link to product 1

.......................................... buy it now 2

.......................................... image 2 .......................................... link to product2

instead of all being on one line as normal.

30 Sep 2011, 3:33 PM
#20
megagente avatar

megagente

New Zenner

Join Date:
Mar 2006
Posts:
14
Plugin Contributions:
0

Re: Buy now button in main page products

This is a nice contribution I already applied it. but the questions is how to make the Buy Now button to go down instead of being first?