Tagged: , , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #15003

    Hey

    Is there any way to move the ‘add to cart’ panel and price to underneath the product description?

    http://cutecreations.co.uk/wp/shop/chickie-necklace

    Kind regards

    Kate

    #85838

    Try following – open up propulsionconfig-woocommerce/config.php and replace:

    add_action( 'avia_add_to_cart', 'woocommerce_template_single_add_to_cart', 30, 2 );

    with:

    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_template_single_add_to_cart', 30, 2 );

    or:

    add_action( 'woocommerce_after_single_product', 'woocommerce_template_single_add_to_cart', 30, 2 );

    #85839

    Hi,

    I’m afraid neither of those worked. It put it underneath the related products instead and not just underneath the description text.

    It also didn’t move the cost of the product along with the box with the add to cart and quantity.

    Kind regards

    Kate

    #85840

    Hi,

    I was able to move both the price and the block with the shopping cart under the description.. The only problem is, to explain it like this in a meaningful way would take hours. Even though its just surgically moving 4 blocks of code. If you can create a temporary password and login for me and email them to usjahm [at] gmail.com , I can make the modifications in 10-15 minutes.

    Thanks,

    Nick

    #85841

    Hi Nick,

    Have sent you the details :-)

    Kind regards

    Kate

    #85842

    I’ve tagged this for Nick so he can quickly re-find it :)

    Regards,

    Devin

    #85843

    Hi Kate,

    Terribly sorry for the delay. I wrote out the plan of attack below:

    1) Please make a backup of config.php inside the config-woocommerce directory in the root of the theme.

    2) In the file config.php, please *delete* from lines 321-332 which look like:

    //price
    if(is_object($product) && is_singular())
    {
    echo "<div class='price_container'>";
    woocommerce_template_single_price($post, $product);
    echo "</div>";
    }

    if(!empty($slider)) {
    avia_add_to_cart($post, $product );
    }

    3) delete a block of code below which starts on line 171 and ends on line 191

    #
    # create the shop navigation with account links, as well as cart and checkout
    #

    function avia_woocommerce_template_single_excerpt($post)
    {
    global $product;

    if(is_singular() && avia_post_meta('hero'))
    {
    echo "<div class='hero-text entry-content'>";
    the_excerpt();
    echo "<span class='seperator extralight-border'></span>";
    echo "</div>";
    }

    echo "<div class='summary-main-content entry-content'>";
    the_content();
    echo "</div>";
    }

    4) and paste the code below on line 171 after deleting the code in step 3

    #
    # create the shop navigation with account links, as well as cart and checkout
    #

    function avia_woocommerce_template_single_excerpt($post)
    {
    global $avia_config, $product;

    if(is_singular() && avia_post_meta('hero'))
    {
    echo "<div class='hero-text entry-content'>";
    the_excerpt();
    echo "<span class='seperator extralight-border'></span>";
    echo "</div>";
    }

    echo "<div class='summary-main-content entry-content'>";
    the_content();
    echo "</div>";
    //price
    if(is_object($product) && is_singular())
    {
    echo "<div class='price_container'>";
    woocommerce_template_single_price($post, $product);
    echo "</div>";
    }

    // echo "-->";
    if(!empty($slider)) {
    avia_add_to_cart($post, $product );
    }
    if(empty($avia_config['slide_output']))
    {
    //$slider = new avia_slideshow(get_the_ID());
    //$slider -> setImageSize('portfolio');
    //echo $slider->display();
    //echo $slider->slideshow_thumbs();
    }
    else
    {
    avia_add_to_cart($post, $product );
    //echo "<h1 class='post-title portfolio-single-post-title'>".get_the_title()."</h1>";
    }
    }

    5) Line 339-343 should look like

    else
    {
    avia_add_to_cart($post, $product );
    echo "<h1 class='post-title portfolio-single-post-title'>".get_the_title()."</h1>";
    }

    so please change them to look like

    else
    {
    echo "<h1 class='post-title portfolio-single-post-title'>".get_the_title()."</h1>";
    }

    * Save, cross your finger, and look at the results. Don’t forget that any update of the theme will undo this edit (update of plugin should not).

    Thanks,

    Nick

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Move add to cart on product page’ is closed to new replies.