Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › eStore-product search with add to cart button, line break after Quantity
Tagged: line breaks, shortcode styling, sidebar quantity
- This topic has 9 replies, 4 voices, and was last updated 11 years, 4 months ago by admin.
-
AuthorPosts
-
August 7, 2012 at 4:57 pm #7099tonerlowSpectator
With Display Quantity turned on for a product the Add To Cart button is separated from the Quantity field by an unsightly line break. Any tips on how to remove? Here’s an example page, [http://printer-pro.com/shop/all-products/]
I have the same issue (unwanted ) in the display of the short code. The text Product Search appears on one line, and the search input box appears on the next line, following by the Submit button on the third line. Tips on styling this short code? Here’s a sample, [http://printer-pro.com/shop/]
Great product!
August 7, 2012 at 11:35 pm #48148PeterMemberThe line breaks for the product display are actually part of the code so to remove them you will need to modify the code.
Look in the eStore_misc_functions.php file and go to the piece of code which looks like this and you can remove the line break:
if($ret_product->show_qty=='1')
{
$replacement .= ESTORE_QUANTITY.': <input type="text" name="add_qty" size="1" value="1" /> ';
if ($line_break) $replacement .= '
';}
August 8, 2012 at 5:53 pm #48149tonerlowSpectatorThanks! That worked great for the product display issue. I’d still like to tweak the appearance of the product-search-with add-to-cart-button shortcode. Which .php file should I look at?
August 9, 2012 at 1:26 am #48150adminKeymasterLook inside the following function of the Extra eStore shortcodes plugin -> eStore-extra-shortcodes.php file:
wp_eStore_product_search_handler
June 16, 2013 at 10:49 pm #48151teenmetalMemberHi,
I’d like to put my quantity field on the same line as my add to cart button as well. I opened up the php filed specified above, and found the line of code that needs editing, but your instructions aren’t clear to me. What exactly do I need to remove to make the line break go away? Here is the code you said to edit–can you describe exactly what needs to be changed?:
if($ret_product->show_qty==’1′)
{
$replacement .= ESTORE_QUANTITY.’: <input type=”text” name=”add_qty” size=”1″ value=”1″ /> ‘;
if ($line_break) $replacement .= ‘
‘;
}
June 16, 2013 at 11:57 pm #48152adminKeymasterHi, Peter suggested one tweak to one user and I did one to another user. So please let me know which tweak you are referring to and I will be able to help.
Can you please tell me which eStore shortcode you are using? Also share a link to the page in question.
June 17, 2013 at 4:43 pm #48153teenmetalMemberHi, I would like my Quantity Field to rest on the same line as my add to cart button. The OP shared a link that shows he was able to do this: [http://printer-pro.com/shop/all-products/]
I did what is described here:
The line breaks for the product display are actually part of the code so to remove them you will need to modify the code.
Look in the eStore_misc_functions.php file and go to the piece of code which looks like this and you can remove the line break:
if($ret_product->show_qty==’1′)
{
$replacement .= ESTORE_QUANTITY.’: <input type=”text” name=”add_qty” size=”1″ value=”1″ /> ‘;
if ($line_break) $replacement .= ‘
‘;
}
But this only resulted in my add to cart button sitting directly underneath the Quantity field. How do I modify the code so that my quantity field is on the same line as my add to cart button as seen here: [http://printer-pro.com/shop/all-products/]
I am using wp estore plugin with payment gateway plugin. Here is the page where I would like to see this happen: [http://apologymagazine.com/issues-dev-page/]
Also seeing line break on instances where I have a product variation dropdown: [http://apologymagazine.com/subscribe/]
June 18, 2013 at 3:23 am #48154adminKeymasterThank you for the details. Do the following tweak which should work:
Search for the following in the “eStore_misc_functions.php” file (it sets the line_break by default):
$line_break=true
Now, change it to the following (there will be a few occurrences):
$line_break=false
That will do that job.
June 30, 2013 at 9:09 pm #48155teenmetalMemberHi, I changed all occurances of $line_break=true to $line_break=false as you suggested and my button is still sitting on the line below the quantity field. FYI: I updated the plugin with a fresh copy after I posted this support request and I cleared my cache. Could the problem be the quantity field is set to display inline?
July 1, 2013 at 1:08 am #48156adminKeymasterLets take a look at the page where you have this. I went to the page you mentioned earlier but I don’t see any quantity field there. Could you please share the link to the page where I can go and take a look?
-
AuthorPosts
- You must be logged in to reply to this topic.