Forum Replies Created
-
AuthorPosts
-
June 5, 2015 at 11:30 am in reply to: Woocommerce custom code in child theme for the product list #455047
I opened another question for the product info problem. So it can be easier for others with the same problem. Please refer to https://kriesi.at/support/topic/how-to-add-custom-product-info-element-to-child-theme
For the custom info in the product list, it has been solved. Thanks.
June 5, 2015 at 4:40 am in reply to: Woocommerce custom code in child theme for the product list #454903any help? how I can override a class with extended in child theme?
Thanks. Fixed.
June 4, 2015 at 5:49 am in reply to: Woocommerce custom code in child theme for the product list #454250Thanks. It works for the product list now in the child theme. But the product info is not working yet. I updated the following function in the enfold/config-templatebuilder/avia-shortcodes/product_snippet_info.php. I tried to put the whole script into the function.php of the child theme but it will become error 500 on the frontend. I tried to comment out extended class “extends aviaShortcodeTemplate” and it fixed the error 500 problem but it shows nothing in the product info area.
function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $output = ""; $meta['el_class']; global $woocommerce, $product; if(!is_object($woocommerce) || !is_object($woocommerce->query) || empty($product)) return; // $product = wc_get_product(); $output .= "<div class='av-woo-product-info ".$meta['el_class']."'>"; ob_start(); // Disabled by Alex // $product->list_attributes(); // Custom Code by Alex to add more product info data $string_item_code = 'Item-code'; if (ICL_LANGUAGE_CODE != 'en'){ $string_item_code = '產品編號'; } if ($product->sku != ''){ echo '<div class="product_sku">'.$string_item_code.': '.$product->sku.'</div>'; } if ($product->post->post_title != ''){ echo '<div class="product_title">'.$product->post->post_title.'</div>'; } if ($product->regular_price != ''){ echo '<div class="product_price_row">'; $product_o_price = $product->regular_price; $product_s_price = $product->sale_price; $product_symbol = get_woocommerce_currency_symbol(); if ($product_symbol == '$'){ $product_symbol = 'HKD$'; } $product_symbol = 'HKD'; if ($product_s_price == ''){ // No Discount if ($product_o_price != ''){ echo '<span class="product_price">'.$product_symbol.wc_price($product_o_price).'</span>'; } } else { echo '<span class="product_price">'.$product_symbol.wc_price($product_s_price).'</span>'; echo '<span class="product_o_price"><del>'.$product_symbol.wc_price($product_o_price).'</del></span>'; echo '<span class="product_percent">'.(($product_o_price - $product_s_price) / $product_o_price) * 100 .'% off</span>'; } echo '</div>'; } // end of custom code by Alex $output .= ob_get_clean(); $output .= "</div>"; return $output; }
June 4, 2015 at 4:54 am in reply to: Woocommerce custom code in child theme for the product list #454226I had the same problem when I updated the product_snippet_info.php for adding some extra content into the product info element shortcode. it only works when I put the code in the parent theme but it doesn’t when the code is in the child theme.
I don’t need the solution now. The screen you show is the page with Avia Layout editor enabled. I need the editor to be enabled now. Thanks for the help anyway.
June 3, 2015 at 4:29 am in reply to: WooCommerce product price on single page not showing with advanced editor #453552I found you can update the script “enfold/config-templatebuilder/avia-shortcodes/product_snippet_info.php” to get back the price for the product in the product info element
function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $output = ""; $meta['el_class']; global $woocommerce, $product; if(!is_object($woocommerce) || !is_object($woocommerce->query) || empty($product)) return; // $product = wc_get_product(); $output .= "<div class='av-woo-product-info ".$meta['el_class']."'>"; ob_start(); $product->list_attributes(); $output .= ob_get_clean(); echo 'Price: '.$product->regular_price; $output .= "</div>"; return $output; }
June 3, 2015 at 4:02 am in reply to: WooCommerce product price on single page not showing with advanced editor #453538I tried to modify the single-product.php. But I can only see the modified content when I disabled the avia layout editor. What script should I modify if I enabled the layout editor? And how can I get the product data on that script?
Also, for the product info element in the enfold editor, why there is nothing to show on the frontend? is this a bug? Is it possible for me to update the script file of this element or where is this script file?
- This reply was modified 9 years, 5 months ago by boscotwcheung.
June 2, 2015 at 9:40 am in reply to: Woocommerce custom code in child theme for the product list #453015I read this post:
https://kriesi.at/support/topic/does-child-theme-read-woocommerce-configconfig-php/But I still don’t know what to do. Any help?
- This reply was modified 9 years, 5 months ago by boscotwcheung.
ok. Thanks.
I found it was my server problem. thanks.
Can I do it with LayerSlider?
When I disabled the Avai Layout editor, the sidebar will show automatically. When I enabled the layout editor, the sidebar will gone.
Thanks.
June 1, 2015 at 11:25 am in reply to: WooCommerce product price on single page not showing with advanced editor #452472I have the same problem. When I enabled the avai layout editor and drag the product info element into the content, it shows nothing in the product info area in the front-end. If it can’t show anything, what is the “product info” element for?
I am okay to use the textbox to manually build the product page, however, I installed a product badge plugin which can show a badge of “Hot”, “New”, “Featured”, etc. It works in the product list page but it doesn’t show up in the product page when the avai layout editor is active. I want to get this thing back and I am thinking to manually add some custom code to the product page. Which php script should I modify? And how can I load the product data like product name, price, publish date, etc in the script??
I found this plugin which is close to what I wanted: https://wordpress.org/plugins/contact-form-7-dynamic-text-extension
However, when I enable this plugin, the enfold advanced layout editor is not able to loaded with the error “wp-admin/admin-ajax.php 500 (Internal Server Error)”
It may be the plugin’s problem, but maybe I should post here as well.
This reply has been marked as private.I want to add custom field to the portfolio too. I tried the two plugins suggested. They enhanced the custom field function but didn’t add the custom field to the portfolio.
I made the menu next to the logo by setting a custom css left:200px to the nav. But I don’t know how can I add some custom things to the header. Do I need to modify the theme files?
This reply has been marked as private.Avia keeps loading when I access it from my office (wifi) but it’s ok from my home (lan).
I am having the same problem.
I removed the double quotes in the href link and it worked. Thank you for the quick response.
Cheers
Bosco- This reply was modified 10 years ago by boscotwcheung.
This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.This reply has been marked as private. -
AuthorPosts