Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › How to change position of Add to Cart Button
Tagged: add to cart, add to cart button, button
- This topic has 8 replies, 5 voices, and was last updated 11 years, 3 months ago by admin.
-
AuthorPosts
-
July 17, 2011 at 6:14 pm #3822tdakoMember
Hi Amin and Co.,
I have a small question about the positioning of the Add to Cart button.
I am using the shortcode, [wp_eStore_add_to_cart id=1] to place the variations and Add to Cart button under a product. What happens is that the variations is on one line, then there is a
<br>
code and then comes the Add to Cart button.Is there a way to move the Add to Cart button so that it is on the same line as the variations options? I tried using the Plugin Editor to find which file has the code to change this, but couldn’t find it.
Maybe you can help…….
Thanks in advance
tdako
July 18, 2011 at 12:32 am #34376amin007ParticipantOpen the “eStore_misc_functions.php” file and look for the following line of code:
$output = get_button_code_for_element($ret_product,true,'',$buttonImage);
Once you find it please change it with the following:
$output = get_button_code_for_element($ret_product,false,'',$buttonImage);
The 2nd argument (false) tells it not to use break line when it creates the button.
July 18, 2011 at 7:03 am #34377tdakoMemberHi Amin,
Thanks very much for the swift answer……just tried it out and of course it works fine.
Cheers
tdako
December 17, 2012 at 5:50 pm #34378bobkSpectatorThis didn’t work for me just now, nor did the solution posted here:
I’m pretty sure I had it working before, and then an update to the plugin moved the button back down where I don’t want it. I went back in to eStore_misc_functions.php and restored these changes, but they had no effect. I also tried other CSS positioning, like
.eStore_add_to_cart_button {display: inline-block;}
The page under development is here: [http://tinyurl.com/bedmhwm]
I want the ‘add to cart’ button placed to the right of the drop-down menu, with their bottom edges aligned.
December 18, 2012 at 4:16 am #34379adminKeymasterYour other post should tell you what change you did earlier so you can reapply them:
December 18, 2012 at 5:43 am #34380bobkSpectatorI re-read that post, but unless I’m missing something, it didn’t contain a solution for moving the ‘add to cart’ button.
Just to be clear, back then I was considering putting all those elements in a single row, but then I decided against it. I settled on having the price and the ‘format’ link (which is a Lightbox Ultimate link) above the variation menu, with the ‘add to cart’ button to the right. If I recall correctly, the method I successfully used for moving the add to cart button was in the following thread, or the one linked within it:
Then, without my having changed anything (that I can recall), the ‘add to cart’ button got pushed down – I think it might have happened after an update to eStore (?).
In Firebug I found a line break after the variation menu, and when I deleted it (in Firebug), the ‘add to cart’ button moved back up where I wanted it.
So the question is ‘how do I get rid of that line break?’ Is it in the php code somewhere? Or am I missing something?
December 18, 2012 at 8:25 am #34381bobkSpectatorRESOLVED:
In post 19611 above, Amin said to search for
$output = get_button_code_for_element($ret_product);
I searched for that string in my text editor (Coda) and got nothing.
Then I tried
$output = get_button_code_for_element
and that got me to the right place, which was line 215 in misc_functions.php.
If Amin’s post from last year is correct, then there was previously no ‘true’ after ‘($ret_product)’. Now there is. I replaced it with ‘false’, and that removed the line break.
Here’s what I think happened: Amin’s fix above worked when I tried it a few months ago, and during one of the recent updates, two things happened: 1) the update over-wrote the modification; and 2) the code changed so that the search he recommended didn’t work when I tried it before. It wasn’t till now that I thought of trying a modified search.
It would be nice if a detailed change log was posted with each update.
August 31, 2013 at 11:15 am #34382AnonymousInactiveI tried the above fix to the misc_functions.php but the add to cart button is till appearing on the next line instead of alongside the product.
I changed:
$output = get_button_code_for_element($ret_product,true,”,$buttonImage);
to:
$output = get_button_code_for_element($ret_product,false,”,$buttonImage);
But the add to cart button still appears on the next line.
Any ideas?
August 31, 2013 at 11:50 pm #34383adminKeymasterHi, Please share a link to the page where you have the button so I can take a look. you want the variations and the button to be all side by side?
-
AuthorPosts
- You must be logged in to reply to this topic.