Bartek
Forum Replies Created
-
Forum: Plugins
In reply to: [ShopMagic - email automation] Error establishing a database connectionHi @debbyroar
Could you provide some detailed information about the issue? WooCommerce’s status report would be great insight at first, and additionally it would be good if you could look into your website’s logs and seek for actual error message.
ShopMagic doesn’t establish any database connection on its own, and it’s most likely a fatal conflict with some other plugin you’ve installed.
Forum: Plugins
In reply to: [ShopMagic Abandoned Cart Recovery for WooCommerce] Not tracking anythingHi @rah2510
Would you mind updating both ShopMagic for WooCommerce and ShopMagic Abandoned Carts to the latest versions? I believe, we might have resolved your issues in recent releases, after your report.
Best regards,
BartekForum: Plugins
In reply to: [ShopMagic - email automation] Billing phone placeholderHi @tomasbud
customer.phonedoesn’t refer to registered users, as ShopMagic have it own definition of customer, and depending on the context it is user or anonymous (not registered) buyer. Thanks to that, you can safely exchangecustomerplaceholders, when you want to access any order data. For that instance,customer.first_nameis equal toorder.billing_first_name, etc.Hope this clarifies the use case and helps you achieve your goal!
Forum: Plugins
In reply to: [ShopMagic - email automation] Billing phone placeholderHi @tomasbud
I must admit, I fooled myself, after 2 years of developing the plugin 😅 Actually, there’s no
order.billing_phoneplaceholder in ShopMagic, and it is not because it’s free version – we just never implemented such placeholder. It seemed so obvious to me, that I was sure we did…Anyway,
order.billing_phonefrom now on is added to our backlog and will be introduced. Fortunately, there is a possibility to get customer number withcustomer.phoneplaceholder (which definitely is implemented).I hope this helps 🙂
Forum: Plugins
In reply to: [ShopMagic - email automation] Billing phone placeholderHi @tomasbud!
To use
order.billing_phoneplaceholder, you need to use order based event, as Order Completed or similar. If you don’t see the placeholder on the list, try either changing the event to other order based or refresh the page – it may be a connection issue. The placeholder you mention is included in main plugin, so there should be no issues using it.Anyway, even if for some reasons the placeholder won’t show up on the list, feel free to use it anyway in your automation: it should be totally fine, as long as you use order based event in the automation.
Nevertheless, pay attention that Twilio requires you to submit a valid number[^1] with country code, and this means you have to somehow enforce it on your customers or filter it, before it is stored in database. ShopMagic doesn’t perform such operation itself, thus you must prepare a valid number.
Forum: Plugins
In reply to: [ShopMagic - email automation] email tracking can’t be disabled (again)I’ve investigated the issue, and it seems LiteSpeed caching plugin on LS servers can produce such results in some configuration (I recreated it with standard recommended settings, but more aggressive caching surprisingly didn’t bring up the issue).
Unfortunately, at the moment the issue is a bit stuck, due to limited cache purging possibilities exposed by LiteSpeed plugin API (you can easily purge the whole website cache, which wouldn’t be appreciated, but tagging a specific URL is difficult).
You mention it doesn’t occur in other plugins. Well, I wouldn’t totally agree, but what makes ShopMagic special is the fact we use REST API for administrative side. Cache plugins usually skip admin area, but REST API is a part of regular WordPress website, subjected to regular caching rules.
Finally, we will get to the bottom of the issue, and it will be fixed. I’m glad that you have found a workaround for the meantime. Again, I apologize for the inconveniences.
Forum: Plugins
In reply to: [ShopMagic - email automation] What the hell happened to version 3?Hi @zappob
Icons display has finally been resolved in 3.0.14 patch update.
During those 6 months, ShopMagic improved its stability and I think all of your remarks about issues have been mended (apart from those discussing design decisions).
I hope, frustration will pass over time, and you will find ShopMagic useful again.
Hi @toddi2303!
Checkout fields are saved as an order meta values, so any
$order->get_meta('_<field_name>')should be able to retrieve custom values (mind the underscore at the beginning of the field name).Alternatively, there’s a class
\WPDesk\FCF\Free\Integration\Integratorin our codebase, which provides an API to access fields and its values in specified order. To make use of this class, you need to hook intoflexible_checkout_fields/init.Here’s an example for getting order field value:
add_action( 'flexible_checkout_fields/init', static function ( $integrator ) { // Get value of custom field for order #13. $field = $integrator->get_field_value( 'custom_field', 13 ); // ... } );Hi @webpandadev!
I guess, we could do better at informing about dropping support for Multilingual add-on, but as you can read in repository description, ShopMagic Multilingual Support has been moved to core plugin since ShopMagic 3.0, thus you can safely delete the extension.
Anyway, could you describe in details, what do you mean that Abandoned Carts doesn’t work when languages are switched?
Additionally, I recommend getting familiar with our documentation about Multilingual feature.
I am closing this thread as it’s eligible for main ShopMagic support request, but you can respond here anyway, if you want to.
- This reply was modified 3 years, 1 month ago by Bartek. Reason: Added info about a reason to close the thread
Hi @araislamara!
I can see some mistakes in your code:
- You don’t attach, but fire an action. Use
add_action, notdo_action - You are trying to attach to hook from within REST API callback, but this way, you try to hook into action after it has been executed. It isn’t possible in WordPress, as you should attach all your hook callbacks before a hook will be dispatched (i.e. with
do_action)
To do this correctly, you should first hook into Flexible Wishlist, and from within, register a REST API route. It is important to preserve a correct order of execution.
Here’s an example:
function get_wishlist_products_by_user( $wishlist_repository, $user_id ) { /** @var array $wishlist One user can have multiple wishlists */ $wishlists = $wishlist_repository->get_by_user( $user_id ); $product_id = []; foreach ( $wishlists as $wishlist ) { $wishlist_items = $wishlist->get_items(); foreach ( $wishlist_items as $wishlist_item ) { $product_id[] = $wishlist_item->get_product_id(); } } return $product_id; } // Hook into Flexible Wishlist initiation point add_action( 'flexible_wishlist/init', // Here we can access WishlistRepository, which we will need to get products for user function ( $_, $wishlist_repository ) { // Register our REST API route add_action( 'rest_api_init', // This may be done better with OOP and keeping wishlist repository as class field // Otherwise, we need to pass it down as closure argument function () use ( $wishlist_repository ) { register_rest_route( 'my_flexible_test', '/v1', [ 'methods' => 'GET', 'callback' => static function () use( $wishlist_repository ) { return rest_ensure_response( get_wishlist_products_by_user( $wishlist_repository, 1 ) ); }, 'permission_callback' => '__return_true' ] ); } ); }, 10, 2 );Hi @araislamara!
Although, there isn’t anything formalized for external use, you could achieve your goal with a bit of coding and reading of our source code (I warn you, it’s an experienced solution).
Flexible Wishlist exposes
flexible_wishlist/inita hook, which has access toWhishlistRepository – a class being able to query the whole wishlist for a user.A code example could look like (please, don’t treat it as production ready code, you need to change it according to your requirements):
do_action( 'flexible_wishlist/init', function ( $_, $wishlist_repository ) { $user_id = get_current_user_id(); $wishlist = $wishlist_repository->get_by_user( $user_id ); $wishlist_items = $wishlist->get_items(); $product_id = []; foreach ( $wishlist_items as $wishlist_item ) { $product_id[] = $wishlist_item->get_product_id(); } // Do something with populated products ids. }, 10, 2 );Forum: Plugins
In reply to: [ShopMagic - email automation] Loading next page of atomations frozenHi @yoschims
We’ve checked the issue you mention, and it occurs, that the bug is connected to permalinks set in your website. A workaround for this, if possible, would be to change permalink settings to other value than plain ID of the post.
Meanwhile, we are adding this to our board, and getting it resolved.
Best regards,
BartekForum: Plugins
In reply to: [ShopMagic - email automation] ShopMagic ignores “Advanced Filter”Hi @chaosproz
Another way to solve this issue would be to upgrade ShopMagic to the latest 3.0.13 release. Our customers have confirmed that it restores correct state of ShopMagic.
We are deeply sorry for the troubles that the bug caused.
Best regards,
BartekSorry, for my late response @kaiyang, and thanks for pinging me 🙂
You are correct, by design we’ve decided to trigger this popup only on cart and checkout pages. Do you think it should be in different places, too? Additionally, pop-up shows at most only once a day.
If you have any suggestions, of how we could improve this feature, let us know, and we will consider it in our development process!
Best regards,
Bartek- This reply was modified 3 years, 1 month ago by Bartek.