Theo Gkitsos
Forum Replies Created
-
Forum: Plugins
In reply to: [Gift Wrapping for WooCommerce] Specific amount for product by IDHi all, I’m going to mark this topic as resolved.
One way to achieve what you want is using @pexlechris code that corrected the mistakes of your original code.
Another way is to add (with custom code) a custom field in the product edit page, and insert the cost for each specific product. Then you can loop the products in the cart, using the code above
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ){.....}
and calculate the total cost based on each product’s custom field.So, there are ways to do this, but you have to hire a PHP developer to write some lines of code for you.
Forum: Plugins
In reply to: [Gift Wrapping for WooCommerce] Currency Converter IssuesHello @sohannnn, you should first update the plugin to the latest version (v1.2.3) and then add this code to your functions.php file or a Code snippets plugin:
add_filter('tgpc_wc_gift_wrapper_cost', function( $cost ) {
global $WOOCS;
if ( ! isset($WOOCS) || ! $WOOCS->is_multiple_allowed ) return $cost;
$current = $WOOCS->current_currency;
if ($current !== $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$current]['rate'];
$cost = $cost * $rate;
}
return $cost;
});Let me know if this worked for you.
Forum: Plugins
In reply to: [Gift Wrapping for WooCommerce] Currency Converter IssuesHello, this free plugin does not support currency conversion out of the box. But there is a way to achieve this using some code.
You have to use the following filter to change the cost depending on user selected currency:
add_filter('pre_option_tgpc_gift_wrapper_cost', function($cost){
// 1. Detect active currency (USD or NPR)
// 2. If USD is selected, convert cost to USD using exchange rate
return $cost;
});The above is an example; you have to make some modifications to make it work. I don’t know how familiar you are with writing code. Maybe if you tell me which plugin you are using for currency conversion, I can further help you.
Thanks for the update. It works fine now.
There is only a PHP deprecation warning in the
response
method because a required parameter is after an optional, but it’s ok. You can consider fixing this in a next version.Thank you very much, I really appreciate it.
Theo
Yes, I couldn’t see any zip in the previous replies, but now is visible.
I just tested it and it works correctly in all scenarios (a & b) and with or without
reauth
parameter.Thank you very much, I really appreciate it ??
Hi @hjogiupdraftplus, I’m sorry I missed your reply.
Scenario (a) for logged-out users seems to work fine when salt postfix is enabled. It works fine both with and without
&reauth=1
parameter.In scenario (b) when an admin is already logged in in another tab, the redirect doesn’t work for both cases where
&reauth=1
is present or not.I initially skipped the reauth parameter in my example because I didn’t want to force the admin to re-authenticate, but just redirect him to the
redirect_to
URL. But it’s not a big problem for me to re-auth. But right now it is still not working for scenario (b) even if&reauth=1
is present.Please have a look again. Thank you
@rhapsody348 ‘s comment fixes indeed the first scenario (a), where a user is logged out and performs the login process. With the
aiowps_login_init
function commented out the redirect works fine.But it still doesn’t work on the scenario (b) when a user is already logged (in another tab for example) and clicks the link with the
redirect_to
. In this case too, the admin should be redirected to the correct page.Yes indeed, that was the problem. Thanks for the fix @rogierlankhorst
Thanks for the quick fix, it’s working fine now! I’m always happy to help, I will keep testing PT.
They made a patch based on your comment and it seems to work fine now. (Support topic)
Thank you for your help!
Ok sure, I will ask their support and I will come back with any news. Thank you!
Forum: Plugins
In reply to: [WooCommerce Smart COD] HPOS SupportThanks
Forum: Plugins
In reply to: [WooCommerce Smart COD] HPOS SupportI don’t understand why. Is this a way to force people to buy your PRO version? So you decide to break compatibility with WC on purpose.
This is not a new feature request. This is absolutely needed in order to update WooCommerce and work with HPOS.
Hi sorry for not replying last week, the workload was huge.
Thanks for working on my problem and finding a solution, your uploaded fix works fine. Problem solved.
Thank you!