hsupyaenaung
Forum Replies Created
-
Forum: Plugins
In reply to: [TP Product Image Flipper for Woocommerce] Srcset to reduce load waitHi
Wow.. that was quick. Done~! Thank you.
Best
HPNHi @ipapilina
After many months, I had encounter same issue lately and realised it has to do with your variation order. If it was not set to order by name, it will disappear. Mine was set to custom order, thus it disappeared.
So, if you still want the attribute list to be translated and have a custom order,
here is what you can do:You have to choose order by name and then, reorder them by using Css.
Example : Wrapper -> display: flex; List -> order: 1, 2, 3, 4 and so on.
This is only the perfect fix I find so far. I hope the plugin author would to address issue in future.. anytime soon.
Hi @ipapilina,
As I read your first statement carefully, I see that you had introduced the new taxonomy
pa_volume
in/plugins/wp-multilang/core-config.json
.Try moving it into a separate file with name wpm-config.json inside your theme folder?
Example:
wp-content/themes/yourtheme/wpm-config.json
The plugin will auto-detect that file.
As for me, I like to put it in some sub dir with custom name so I am using the filter as follows:
add_filter('wpm_json_files', function ($config_files){ $config_files[] = get_template_directory() . '/custom_directory/custom_wpm-config.json'; return $config_files; });
Also, remove this code:
add_filter('wpm_taxonomies_config', function ($taxonomies_config) { // this part to enable render filters on shop/category/tag if (is_admin() || is_cart() || is_checkout()) { $taxonomies_config['pa_volume'] = []; } // some add to cart decoration if (is_product() && $_SERVER['REQUEST_METHOD'] === 'POST') { $taxonomies_config['pa_volume'] = []; } return $taxonomies_config; }, 10); add_filter('woocommerce_product_variation_get_name', function($value, $entity){ return $entity->get_title(); },10,2);
I am only introducing new taxonomy to .json file to translate that part.
Make sure you have added new Product Attribute and have it translated at
Attributes
panel.For your case the attribute slug should be named “volume” only. Then, select that attribute when you create variable product, and try following up the setting as I have stated previously?
[ ] Visible on the product page [x] Used for variations And for the Variations: [x] Enabled: [ ] Downloadable: [ ] Virtual: [ ] Manage stock?
- This reply was modified 4 years, 3 months ago by hsupyaenaung.
- This reply was modified 4 years, 3 months ago by hsupyaenaung.
Hey @ipapilina,
I also had the same issue as you even after I added the second code you described at the functions.php. Then I found out you have to play around with some setting at your product post. In the end, I didn’t add any code for my functions.php for it.
If I remembered correctly, it solution lies within Attributes / Variations tabs under “Product data” panel.
Here are my settings for Attributes:
[ ] Visible on the product page
[x] Used for variationsAnd for the Variations:
[x] Enabled: [ ] Downloadable: [ ] Virtual: [ ] Manage stock?Let me know if it turns out well for you.
HPN
Oh my~! It starts to work like a charm when both of our codes are combined.
Thanks man~ I feel so blessed. ??
Hey @shostakmaksim
I’m glad it helped. Does it conflict with woocommerce variation dropdown (single page) for your theme as well?
Sadly, this conflict with woocommerce plugin and the variation dropdown becomes empty. Any thoughts?
Found the solution myself. Had to update custom product attribute under taxonimies at wpm-config.json.
Like so:
"taxonomies": { "yada": {}, "yadayada": {}, "yadayadayada": {}, "yadayadayadayada": {}, "yadayadayada": {}, "pa_size": {} },
- This reply was modified 4 years, 6 months ago by hsupyaenaung.
Hey Jonathan,
It’s working perfectly after doing that. Thank you so much. I thought it would be needed to do lots of overhaul. I guess that is it. Once again, thanks all for your support.
I wouldn’t be able to diagnose the cause of this if Steven didn’t direct me to jQuery Migrate Helper plugin as well ??
Same.. I rarely noodle around with java unless it is really neccessary.
And yes, here are the 2 regarding the log.
$('.meta_box_repeatable_remove').live('click', function () { $(this).closest('tr').remove(); return false; });
// repeatable fields $('.meta_box_repeatable_add').live('click', function (e) { // clone e.preventDefault(); var row = $(this).closest('.meta_box_repeatable').find('tbody tr:last-child'); var clone = row.clone(); clone.find('select.chosen').removeAttr('style','').removeAttr('id','').removeClass('chzn-done').data('chosen', null).next().remove(); clone.find('input.regular-text, textarea, select, .meta_box_upload_file ').val(''); clone.find('input[type=checkbox], input[type=radio]').attr('checked', false); clone.find('span.meta_box_filename').html(''); /** = i have to restore functionality of buttons */ var clndbtn = clone.find('.meta_box_upload_file_button'); var clndbtnimg = clone.find('.meta_box_upload_image_button'); var cleanImgFieldBtn = clone.find('.meta_box_clear_image_button'); clone.find('img.meta_box_preview_image').attr('src',''); addUploaderFunctionToButton(clndbtn); addImageuploaderFunctionToButton(clndbtnimg); clearImgField(cleanImgFieldBtn); row.after(clone); // increment name and id clone.find('input, textarea, select') .attr('name', function (index, name) { return name.replace(/(\d+)/, function (fullMatch, n) { return Number(n) + 1; }); }); var arr = []; $('input.repeatable_id:text').each(function () { arr.push($(this).val()); }); clone.find('input.repeatable_id') .val(Number(Math.max.apply(Math, arr)) + 1); if (!!$.prototype.chosen) { clone.find('select.chosen') .chosen({allow_single_deselect: true}); } // return false; });
- This reply was modified 4 years, 7 months ago by hsupyaenaung.
Oh yes~!
Thanks Steven. This temporarily solved the issue and starts to show the log. But I am not sure how I can fix it still. The log is as follows:
metabox/admin/js/scripts.js:130:36): jQuery.fn.live() is deprecated metabox/admin/js/scripts.js:172:32): jQuery.fn.live() is deprecated
So WP no longer supports
jQuery.fn.live()
? is there any alternatives?