FullStack-ing
Forum Replies Created
-
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Ultralight weight requestHi again,
I’ve figured out two solutions for you.
At first, the reason loco translate can’t find the “fee” string inside our plugin, is because the string is in your functions.php and not in the plugin.
First solution:
Change
$string = __( 'fee', 'wc-smart-cod' );with
$string = __( 'Fee', 'woocommerce' );The “F” should be uppercase.
And let the WooCommerce’s translation take over. ( You should have installed the WooCommerce translations of all the languages you use in your site. )Second solution:
Use
$string = __( 'fee', 'xxxxxx' );Where xxxxxx should be your theme’s text domain. E.g if you use storefront, it should be
$string = __( 'fee', 'storefront' );- Then go to Loco Translate / Themes
- Click in your theme’s name / Setup ( Here you can find the text domain as well
- In source file paths, add “functions.php” without the quotes and click Save Config
- Go to Overview / Edit Template and click Sync
- The fee string should now be scanned. Click Save
Now go to your languages and translate it one by one.
Let me know if any issues.Best Regards
- This reply was modified 8 years, 2 months ago by FullStack-ing.
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Product Category Restriction issueHi,
The category issue is done on purpose, to avoid heavy calculations on the front end while the user trying to checkout. But we will change this to check categories recursively in the next version.
Now for the message position, that’s not something you can change right now. You may want to try a flex / order css combination to achieve this, but you won’t have support for older browsers.
Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Please use Trunk SVN in WordPress.orgOk, no problem.
The .pot file should be included though, right?Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Please use Trunk SVN in WordPress.orgHi Jose,
Sure I will address this issue.
Should all the latest version files moved to the trunk or just the po / mo / pot translation files?Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Getting error on Pay Order PageHi,
It will be part of our next update soon.Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Ultralight weight requestHi,
I will check this and give you a solution soon.Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] currency switcher compatibilityHi cupiditee,
Unfortunately I can’t test this scenario, because it’s a paid plugin and I don’t own it.
So you have to test it yourself.Let me know if I can help.
Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] User role conflictHi,
Any feedback on this?Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Ultralight weight requestHi,
For the class on the span please replace
$fee = sprintf( '<span>%s %s</span>', html_entity_decode( $fee, null, "UTF-8" ), $string );with
$fee = sprintf( '<span class="%s">%s %s</span>', 'wsc-input-fee', html_entity_decode( $fee, null, "UTF-8" ), $string );Change ‘wsc-input-fee’ with the classname of your choice, if you prefer.
Now for the translate part. As you can see the string is translate ready:
$string = __( ‘fee’, ‘wc-smart-cod’ );
Are you familiar with gettext and po – mo files?
Do you use WPML for the translations?Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Bug in “Disable if cart amount is greater than”Hi,
Not problem at all 🙂It will be lot appreciated, if you give us a review.
Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Bug in “Disable if cart amount is greater than”Hi again,
I doubt that is WooCommerce’s issue.
Why don’t you simple remove the div tags and let the p tag as it is?Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Bug in “Disable if cart amount is greater than”Hi again,
I already run it through W3 validator, this is how I got the error line.
You have to copy paste from the “view page source” to W3 validator.Also a div inside a p is not a valid html. Probably that’s the issue.
( see here: https://stackoverflow.com/questions/10763780/putting-div-inside-p-is-adding-an-extra-p )
- This reply was modified 8 years, 2 months ago by FullStack-ing.
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Bug in “Disable if cart amount is greater than”Hi Attila,
The problematic closing p tag, is in your terms and conditions markup.
More specific it’s
</div> <!-- .et_pb_section --><strong></p>
You notice the </p> in the end?
It’s in line 833 ( if you hit right click and view page source )Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Getting error on Pay Order PageHi divijc,
Please replace your wp-content/plugins/wc-smart-cod/public/class-wc-smart-cod-public.php
with the one in this wetransfer: https://wetransfer.com/downloads/c0889a9371157b99c2ef55626d82234d20180215211725/96463c20d4ca13ccbce27db18f161e6a20180215211725/6212edLet me know if the issue is solved, so I can integrate it in the next plugin version.
Best Regards
Forum: Plugins
In reply to: [Smart COD for WooCommerce] Ultralight weight requestHi Adrenaline22,
Your feature is now ready :).
Please proceed to the following steps.
a.) Replace your wp-content/plugins/wc-smart-cod/public/class-wc-smart-cod-public.php with the one I send you in the following WeTransfer ( I’m going to integrate this code in the next release of the plugin, so you don’t have to replace it more than once ).
WeTransfer Link: https://wetransfer.com/downloads/7422a684f862382e638025e046d9162d20180215205034/0d958d91a6f440753ce19ae54659c8d420180215205034/ec0828b.) Copy paste this code block in your theme’s functions.php
add_action( 'woocommerce_update_order_review_fragments', 'insert_price_to_title' ); function insert_price_to_title( $data ) { // settings $string = __( 'fee', 'wc-smart-cod' ); // settings end. global $woocommerce; $doc = new DOMDocument(); $doc->loadHTML( mb_convert_encoding( $data[ '.woocommerce-checkout-payment' ], 'HTML-ENTITIES', 'UTF-8' ) ); $finder = new DomXPath( $doc ); $classname = 'payment_method_cod'; $node = $finder->query( "//*[contains(concat(' ', normalize-space(@class), ' '), ' $classname ')]" ); $label = $node->item( 0 ); if( ! $label ) return $data; $label = $label->getElementsByTagName( 'label' )->item( 0 ); $smart_cod = new Wc_Smart_Cod_Public( 'wc-smart-cod' ); $fee = $smart_cod->apply_smart_cod_fees( $woocommerce->cart, false ); $fee = wc_price( $fee, true ); $fee = sprintf( '<span>%s %s</span>', html_entity_decode( $fee, null, "UTF-8" ), $string ); $fragment = $doc->createDocumentFragment(); $fragment->appendXML( '<span>(' . $fee . ')</span>' ); $label->appendChild( $fragment ); $doc->removeChild( $doc->doctype ); $doc->replaceChild( $doc->firstChild->firstChild->firstChild, $doc->firstChild ); $data[ '.woocommerce-checkout-payment' ] = $doc->saveHTML(); return $data; }c.) The string “fee” is translatable under our text domain ( wc-smart-cod ). You can change this to your theme’s text domain, if you want.
And you are ready. Please let me know if any issues.
Best Regards