-
AuthorPosts
-
February 14, 2016 at 1:39 pm #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
JessicaFebruary 15, 2016 at 5:33 am #583077Hi 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,
IsmaelFebruary 15, 2016 at 11:20 am #583267Good morning Ishmael
have the code copied to the function.php, but the code generates a 500 server error.
What now?
greeting
JessicaFebruary 16, 2016 at 8:24 am #583938Hey!
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,
IsmaelFebruary 16, 2016 at 11:15 am #584060Good 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
JessicaFebruary 16, 2016 at 11:27 am #584072Good 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
JessicaFebruary 18, 2016 at 6:18 am #585172Hey!
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,
IsmaelFebruary 18, 2016 at 9:59 am #585256Hallo Ismael,
excuse that we give so much trouble you, but unfortunately it does not work.
greeting
JessicaFebruary 19, 2016 at 5:49 am #585850Hey!
We modified the code and it is working now. Please check: http://mexx.paris/?product=sweety-tips-500er-sortiment
Cheers!
IsmaelFebruary 19, 2016 at 9:55 am #585933Good Morning Ismael
Thanks, works very well.
Greetings and a nice Weekend
Jessica
February 19, 2016 at 11:30 am #585956UPDATE – 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
JessicaFebruary 20, 2016 at 6:04 am #586391Hey!
Please add this css code:
.single-product-summary + .button { position: absolute; top: -20px; right: 0; }
Cheers!
IsmaelFebruary 20, 2016 at 9:41 am #586421Good 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, 10 months ago by MATTIA.
February 21, 2016 at 6:37 am #586582 -
AuthorPosts
- The topic ‘Button Single Product Page’ is closed to new replies.