
-
AuthorPosts
-
May 5, 2014 at 8:25 am #260111
Hi,
Can you please help me with the following?
1. On Shop page, I would like to add a new line to the Inner Product Header for each Product thumbnail, right below the name of the package and the price. It needs to be different for each product, so a custom field would be great.
2. On Product page, the left top thumbnail has hover effect and once clicked on it, it opens. Where can I specify to have it as a plain image without any effects?
3. On Shop page, the sorting of the Product Thumbnails is always different. In WooCommerce settings, I have specified to “Sort by Price desc”. It does the job but it swaps around randomly products with the same price. I thought setting up each product’s “published time” as I want them to be displayed would help, but it doesn’t.
Here is link to the shop on the website: http://presentationclub.net/shop/
Hope you can help.Thank you,
StelaMay 7, 2014 at 8:57 am #261196Hi Stela!
1) In wp-content/themes/enfold/config-woocommerce/config.php search for:
function avia_shop_overview_extra_header_div() { echo "<div class='inner_product_header'><div class='avia-arrow'></div>"; }
You can add your custom code to this function, below the echo code.
2) In wp-content/themes/enfold/config-woocommerce/config.php replace:
return sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_title, $image);
with
return sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom noLightbox" title="%s">%s</a>', $image_link, $image_title, $image);
3) The only solution I can think of is to use the “Default sorting (custom ordering + name)” option. Then go to Products > Sort Products and reorder the products with drag’n’drop.
Best regards,
PeterMay 8, 2014 at 1:56 am #261552Hi Peter,
Thank you for your reply. Some things worked, some I could’t figure out.
1. Unfortunately, I can’t write code. Would you be able to write it for me? All I need to says is “6 months” under the price on all 7 products.
2. I couldn’t find the code which you wanted me to replace. I searched the woocommerce config.php file, but I can’t find any of the code. I tried to look for “woocommerce-main-image”, also for “return sprint”, but there is nothing like that.
3. Perfect. This sorting seems to work well. Thank you.
4. One more thing. On the home page, under the main banner slides, there are 5 links to packages with a background image of people. The homepage looks perfect on computer, but I checked it on iPad. It moves the background image and reads it from left, so the links overlap the image and it becomes hard to read. Is there any way I can make this background image responsive, so by viewing on different screens it doesn’t change the layout?
Thank you very much again. I appreciate your help.
Stela
May 9, 2014 at 9:22 am #262253Hi!
1) Please update the theme to the latest version 2.7.1 – this will also solve no 2. (and you’ll be able to find/modify the code).
2) Yes, replace:
function avia_shop_overview_extra_header_div() { echo "<div class='inner_product_header'><div class='avia-arrow'></div>"; }
with
function avia_shop_overview_extra_header_div() { echo "<div class='inner_product_header'><div class='avia-arrow'></div>"; echo "6 months"; }
3) Did you try to change the position of the background image on the “Color Section” option screen – maybe try “top center”: http://www.clipular.com/c/5678544864673792.png?k=jR2lqRzMYtESGH2D1K0xy0KW30Q
Best regards,
PeterMay 12, 2014 at 2:12 am #263025Hi,
Thank you very much Peter.
1. It’s working. Is there a way to get rid off the link on the word “6 month”?
1b. Also, I need to create more products, but they will have different sign up options (1 months, 3 months and 12 months). How can I differentiate which products are in which sign up option? I was thinking using the ID of each product to specify which products are 6 months subscription, which are 1 months, etc. Something like for example stating in the code: “ID: 2354; 2374, are 6 months”; “ID: 2359; 2362 are 3 months”, etc..”. Hope you can understand what I mean?
2. This works well, but still there is a link for the image to open in a separate page. Can I completely remove the link?
3. Yes, this works better at least once resizing it stays centred. Thank you, I think I can live with that:)
Once again, you have been very helpful Peter, thank you.
Best Regards,
Stela
May 12, 2014 at 2:19 am #263028Hi Peter, I apologise. Please disregard No.1 comment. It’s working well, I just realised it’s the whole thumbnail linking to the page not just the word “6 months”. Must be too early in the morning:) But I would still like to know if there is any solution to No.1b. Thank you, Stela.
May 13, 2014 at 8:16 am #263779Hey!
1b) You can use custom field values (click on “Screen Options” on the top right corner to show the “Custom fields” option field on the product editor page) to set different values for different products. Instead of
echo "6 months";
use this code:
$value = get_post_meta(get_the_ID(), 'custom_delivery_time', true); if(!empty($value)) echo $value;
and on the product editor page insert “custom_delivery_time” into the first field (key name) and 6 months into the second field: http://www.clipular.com/c/4982606751858688.png?k=aqKhvkFkIcmJ9X0Yit-nXAz8OT8
3) Yes, if you want to remove the link try to replace:
return sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_title, $image);
with
return sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom avianolink" title="%s">%s</a>', $image_link, $image_title, $image);
Best regards,
PeterMay 14, 2014 at 6:28 am #264493Hi Peter,
1b. Works perfect! Thank you.
2. This new code removes the link, but now it opens as an image again (I deleted the previous code you gave me with “noLightbox”) . I am not sure how to blend both actions together. I don’t want to experiment, the other day I modified some code and the whole website went blank. I couldn’t even get into the back-end, nothing. Finally, I amended the code through hosting. Scared the hell out of me.
Thank you very much.
Stela
-
AuthorPosts
- The topic ‘WooCommerce – Inner Product Header, Hover Effect and Sorting’ is closed to new replies.