johnfotios
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: contentSize not being applied to frontend of block themeSorted it. Forgot to set “Inner blocks use content width” in sidebar.
Followed the guide here: https://www.tychesoftwares.com/docs/docs/abandoned-cart-for-woocommerce-lite/track-only-genuine-visitor-carts/
will see if it helps
Sorry I didn’t reply to this. After doing a lot of setting up with PPOM, the client’s spec changed and it ended up being a standard woocommerce variable product… lol
@poena thank you for taking the time to reply, your article is very helpful, and this one https://fullsiteediting.com/lessons/adding-full-site-editing-features-to-classic-themes/
I create websites/custom themes for clients and essentially just use WordPress as a cms. Most of my clients DO NOT want to edit their sites themselves, and it’s me that does all of the editing… so FSE is not necessary as I’m more comfortable writing the code and css.
Does that sound right to you? FSE looks to be aimed at users who want to change things on their site _after_ installing the theme.
I love the Gutenberg editor for editing page content, so it’s not that I’m against blocks.
Dumb question – do you think that ‘classic’ themes will eventually become deprecated?
I don’t understand how any php plugins will work with block themes. How will I write custom php when making a theme? I did a woocommerce site recently and had to pull out all the variation prices into a table for each product. How would I do anything like this with a block theme? Block theme only uses blocks and html. What am I missing?
Forum: Plugins
In reply to: [Product Variations Swatches for WooCommerce] Increase image thumbnail sizeOk, so the thumbnail images use the WooCommerce gallery thumbnail size, which is 100×100 by default. This can be changed in your theme functions (or possibly in your theme settings).
What I added to functions.php
add_theme_support('woocommerce', array( 'gallery_thumbnail_image_width' => 200 ));
Once done, you’ll have to regenerate thumbnails (there’s a plugin)
Hi @webtoffee
I added the google analytics script to header.php in the theme directory
Where would I put it to work with this plugin?
Hey @calcurianluis, you need to add a PPOM field which has the same options/values as your variations dropdown first, then use:
// match variable product variations to PPOM field (for conditional logic) var $VariationSelectID = jQuery("#your_variation_select_ID"); var $PPOMSelectID = jQuery("#your_PPOM_select_ID"); $VariationSelectID.on("change", function() { var VariationSelect = $VariationSelectID.val(); var dataOptionId = VariationSelect.replace(/-/g, "_"); var $PPOMSelectOption = $PPOMSelectID.find("[data-optionid='" + dataOptionId + "']"); $PPOMSelectOption.prop("selected", true); $PPOMSelectID.trigger("change"); }); // if you want to disable the PPOM field $('#your_PPOM_select_ID').prop('disabled', 'disabled');
Replace #your_variation_select_ID and #your_PPOM_select_ID with the IDs from the select fields. I hope this helps.
Ok… final update! I’ve got it working by setting the option price to 00.0000000000000000000000001. lol.
This lets options appear and show as £0.00 without breaking the Options Total or Total.
I noticed a quirk… which works but doesn’t actually work. The price field lets you enter a string, not just numbers, so I set the price to “free”, it now works and adds the option to the price table, showing it as £0.00. Great!
But now this breaks the Options Total and Total fields, which get stuck as £0.00!
On line 557 (I think) it’s got
if (price == 0) return;
If I comment this out, it works. It will add products priced at 0 to the table.
Unfortunately it doesn’t work if the field type is Image… is there something else for images?
I’m looking in ppom-price.js, line 361
ppom_add_price_item_in_table(option_label_with_qty, option_price_with_qty, 'ppom-variable-price', '', option);
Is there something here I can amend? I thought there might be something checking if option price > 0?
- This reply was modified 3 years, 2 months ago by johnfotios.
- This reply was modified 3 years, 2 months ago by johnfotios.
Ok thanks – that’s what my original question was, can I use the PPOM conditional logic with the default woocommerce product variations (the answer is no). Sorry if that wasn’t clear.
For anyone interested, I created a PPOM select field which I set to always have the same value as the variation with js. Then I set the PPOM select field to disabled and hid it with css.
When I use the conditional options, it seems I can only check fields which are also set up in PPOM. I can’t check the variation (using the default woocommerce variations). Is that right?
I’ve found a way around it, though!
Forum: Plugins
In reply to: [Genesis Custom Blocks] Is it possible to hide the “front-end” preview?What I’ve done as a “half fix”, is to create a preview.php and block.css for the block, and just put the title of the block and a “click to edit” wrapped in a div in preview.php, then styled it up as text-align:center, padding:100px 10% and border:1px solid #111;
That way it looks neat at least.
I appreciate that I should make an effort to create a real preview. But I am small web developer working on smaller projects, so there’s time/money constraints etc.