Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #582932

    Hallo Josue
    Hallo Ismael,

    I just need a please help.

    Ismael has integrated me following code in the “funktion.php”, works great!

    // adjust settings on init
    add_action(‘init’,’ava534345953_init’, 50);
    function ava534345953_init() {
    add_action( ‘woocommerce_after_single_product_summary’, ‘avia_add_sidebar’, 25);
    }

    function avia_close_image_div() {
    global $avia_config;
    echo “</div>”;
    }

    function avia_add_sidebar() {
    if(is_product()) {
    $avia_config[‘currently_viewing’] = “shop_single”;
    get_sidebar();
    }
    }

    and in the CSS this code:

    .single-product-main-image {
    width: 25%;
    }

    .single-product-summary {
    overflow: hidden;
    width: 45%;
    float: left;
    margin-right: 5%;
    }

    If I insets code of Josue, a 500 server error appears:

    function avia_close_image_div()
    {
    global $avia_config;
    if(is_product()) {
    $back =$_SERVER[‘HTTP_REFERER’];
    if((isset($back) && $back !=”)) echo ‘Go back‘;
    $avia_config[‘currently_viewing’] = “shop_single”;
    get_sidebar();
    }
    echo “</div>”;
    }

    Could you adjust the final code, thank you.

    The button must not be placed strictly under the single product image.
    The main thing customers have the option of having to go to the previous page.

    Many thanks.

    greeting
    Jessica

    #583077

    Hi MEXX!

    Thank you for using Enfold.

    Remove the other code then combine it with the “avia_add_sidebar” function:

    function avia_add_sidebar() {
    	global $avia_config;
    	if(is_product()) {
    		$back = $_SERVER['HTTP_REFERER'];
    		if(isset($back) && $back != "") echo '<a href="'.$back.'" rel="nofollow">Go back</a>';
    		$avia_config['currently_viewing'] = "shop_single";
    		get_sidebar();
    	}
    }
    

    Regards,
    Ismael

    #583267

    Good morning Ishmael

    have the code copied to the function.php, but the code generates a 500 server error.

    What now?

    greeting
    Jessica

    #583938

    Hey!

    Did you remove the other codes as explained above? Please remove this code:

    function avia_close_image_div()
    {
    global $avia_config;
    if(is_product()) {
    $back =$_SERVER[‘HTTP_REFERER’];
    if((isset($back) && $back !=”)) echo ‘Go back‘;
    $avia_config[‘currently_viewing’] = “shop_single”;
    get_sidebar();
    }
    echo “</div>”;
    }

    .. then look for this one:

    function avia_add_sidebar() {
    if(is_product()) {
    $avia_config[‘currently_viewing’] = “shop_single”; 
    get_sidebar();
    }
    }

    Replace it with the combined function here: https://kriesi.at/support/topic/button-single-product-page/#post-583077

    Regards,
    Ismael

    #584060

    Good morning Ismael

    Thanks for the quick help.

    Your code on the single-Product-Page (Sidebar right) works without problems.

    The code (for “GO BACK”), I had to remove because it produces a 500 server error. And a white page produced.

    If I have you now understood correctly, then we can not use the code (for “GO BACK”). This is a shame because we wanted to use on the Single-Product-Page for other widget sidebar right. And not again for Product Categories.

    Do you listen to any idea how we can integrate a “GO BACK” on the single-Product-Page?

    greeting
    Jessica

    #584072

    Good morning Ismael

    UPDATE TO PREVIOUS POST !!

    If we insert the widget area under Single Product Page a widget does not work. If we insert a widget in “Displayed Everywhere” is visible on the Single-Product-Page. But unfortunately also visible in the sidebar SHOP OVERVIEW PAGE and that should not be so.

    greeting
    Jessica

    #585172

    Hey!

    Please post the login details here so that we can check it. The “go back” button will only work if you go to a single product page from a previous page. It’s not going to work if you go to the single product page directly.

    Regards,
    Ismael

    #585256

    Hallo Ismael,

    excuse that we give so much trouble you, but unfortunately it does not work.
    greeting
    Jessica

    #585850

    Hey!

    We modified the code and it is working now. Please check: http://mexx.paris/?product=sweety-tips-500er-sortiment

    Cheers!
    Ismael

    #585933

    Good Morning Ismael

    Thanks, works very well.

    Greetings and a nice Weekend

    Jessica

    #585956

    UPDATE – 585850 + 585933

    Hi Ismael,

    I’ve just seen the sidebar should be a little to the left. Align or starting with the “GO BACK” button. You is shown again in full width.

    Thanks in advance.

    greeting
    Jessica

    #586391

    Hey!

    Please add this css code:

    .single-product-summary + .button {
        position: absolute;
        top: -20px;
        right: 0;
    }

    Cheers!
    Ismael

    #586421

    Good morning Ismael

    thank you looks great and works perfectly.

    Then we can close the ticket.

    Nice weekend.

    greetings
    Jessica

    • This reply was modified 8 years, 9 months ago by MATTIA.
    #586582

    Hey!

    Great! Glad we could help. :)

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Button Single Product Page’ is closed to new replies.