-
AuthorPosts
-
October 5, 2014 at 12:56 pm #330470
Hi
On my iphone when you view a product, using woo, the buy button is at the bottom of the page and below the widgets. I would like to be above the widgets.Here is an example on mobile. The customers has to scroll through to much information to be able to buy the item
Thx
JoeOctober 6, 2014 at 2:29 pm #330898Hi islandjoe1!
Please use the code provided here to display your sidebar at the right side of the page – http://kriesi.at/documentation/enfold/change-woocommerce-single-product-page-layout/
Elements on the left side will always be displayed before the ones the right side.Best regards,
YigitOctober 11, 2014 at 12:12 pm #334293I add this to the CSS and it is not working for me, please advise and thx
JoeOctober 13, 2014 at 2:16 pm #334905Hey!
You should add the code to Functions.php file in Appearance > Editor and not to Quick CSS field
Cheers!
YigitOctober 13, 2014 at 3:18 pm #334954Hi
I add the below code to my functions file and the buy buttons did move up on my mobile site as request, but now the images on my desktop are huge and distorted, please advise how to correct this this make the image the right size for desk topI added this code to funcions
#
# wrap single product image in an extra div
#
add_action( ‘woocommerce_before_single_product_summary’, ‘avia_add_image_div’, 2);
add_action( ‘woocommerce_before_single_product_summary’, ‘avia_close_image_div’, 20);
function avia_add_image_div()
{
echo “<div class=’four units single-product-main-image alpha’>”;
}function avia_close_image_div()
{
global $avia_config;
$avia_config[‘currently_viewing’] = “shop_single”;echo “</div>”;
}#
# wrap single product summary in an extra div
#
add_action( ‘woocommerce_before_single_product_summary’, ‘avia_add_summary_div’, 25);
add_action( ‘woocommerce_after_single_product_summary’, ‘avia_close_summary_div’, 3);
function avia_add_summary_div()
{
echo “<div class=’five units single-product-summary’>”;
}function avia_close_summary_div()
{
echo “</div>”; //close out the summary
echo “<div class=’three units single-product-sidebar’>”;
get_sidebar();
echo “</div>”;
}October 13, 2014 at 3:30 pm #334968I had to remove the code for now, as customers are complaining about the image size, but they are huge, please advise and thx again
October 15, 2014 at 12:39 pm #336081Hey!
Please add following code to Quick CSS and adjust as needed
.single-product-main-image { width: 20%; }
Best regards,
YigitOctober 15, 2014 at 1:14 pm #336098Hi
added the above code to the quick css and took it down to 5% with no results. Any other suggestions
Thx
JoeOctober 15, 2014 at 1:21 pm #336102Hey!
Have you tried flushing browser cache and refreshing your page a few times after applying the code?
If you did, please also try adding !important rule as following.single-product-main-image { width: 20% !important; }
Cheers!
YigitOctober 15, 2014 at 1:44 pm #336121Sorry for this but I deleted the code that goes in the functions file and when I copy the above code my screen goes until i deleted and the link with the code is giving me a 404, so this time I will save it better. Once you send it, I will add the custom css
Thx
JoeOctober 15, 2014 at 2:23 pm #336138Hi
I tried all that and nothing worked. It worked before when I copy the code from the link you sent me, but it is now a 404 and I think when I copy it from here, something is going wrong. When you get a chance, can you please resendThx
JoeOctober 15, 2014 at 2:33 pm #336146Hi!
Please only use the code i posted here – https://kriesi.at/support/topic/buy-button-above-widgets-on-mobile/#post-336102
and do not add the code to functions.php fileRegards,
YigitOctober 15, 2014 at 3:41 pm #336181I am putting this code > .single-product-main-image { width: 20% !important; } in the custom css file as you said
I need the first code you sent me. the one you told me to add to the functions
#
# wrap single product image in an extra div
#
add_action( ‘woocommerce_before_single_product_summary’, ‘avia_add_image_div’, 2);
add_action( ‘woocommerce_before_single_product_summary’, ‘avia_close_image_div’, 20);
function avia_add_image_div()
{
echo “<div class=’four units single-product-main-image alpha’>”;
}function avia_close_image_div()
{
global $avia_config;
$avia_config[‘currently_viewing’] = “shop_single”;echo “</div>”;
When I copy it from above it does not work, but worked before, so I need a new copy please
Sorry for the confusion
JoeOctober 15, 2014 at 3:47 pm #336185Hi Joe
I am sorry for the confusion as well. That code is no longer needed since product page columns are no longer using units. Using only css code should be enough
Cheers!
YigitOctober 15, 2014 at 9:41 pm #336398Hi
Back to the original request. I need the widgets on the product pages to be on the right had side, because when you visit my site on mobile, you have to scroll to the bottom of the page to view the add to cart button, which is the add to cast button needs to be a the top of the pageView on mobile to add to cart button at bottom of page > https://www.islandjoescoffee.com/online-coffee-store/12oz-island-joes-coffee/12oz-beemers-papua-new-guinea-coffee/
I added this to the quick css > single-product-main-image { width: 20% !important; }
Flushed dns – deleted cache and even restarted my computer and the code has no affect.
Thx for the continued help and please advise
Joe
October 20, 2014 at 1:46 pm #338298Any ideas and how to do this
thx
joeOctober 28, 2014 at 7:48 am #342058Hi Joe,
Try adding this at the very end of your theme / child theme functions.php file:
function add_custom_script(){ if(is_singular('product')){ ?> <script> (function($){ $(window).load(function(){ if (window.matchMedia("(min-width: 767px)").matches){ $(".single-product-main-image").before($(".single-product-summary")); } }); })(jQuery); </script> <?php } } add_action('wp_footer', 'add_custom_script');
Regards,
Josue- This reply was modified 10 years, 1 month ago by Josue.
October 30, 2014 at 4:56 pm #343479Add this to the end of the function.php child theme and got a black white screen.
function add_custom_script(){
if(is_singular(‘product)){
?>
<script>
(function($){
$(window).load(function(){
if (window.matchMedia(“(min-width: 767px)”).matches){
$(“.single-product-main-image”).before($(“.single-product-summary”));
}
});
})(jQuery);
</script>
<?php
}
}
add_action(‘wp_footer’, ‘add_custom_script’);thx for continuing to help.. if you can help me, it will make mobile surfing my site better
joe
October 30, 2014 at 5:56 pm #343502October 30, 2014 at 10:35 pm #343765I think we are headed in the right direction. The code did not white out the screen. It put the Add to Cart button at the top of the page on both mobile and desktop, but it moved the image almost to the bottom of the page and even below the description. The image should be at the top of the page with the Add to Cart button under it, then the description and then the widgets
Take a look
And many thx for the continue support
Joe
November 3, 2014 at 6:31 am #345086Hey Joe!
Can you post a screenshot/mockup of what would you want to achieve for the product view on mobile?
Best regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.