Bartek
Forum Replies Created
-
Hi @tomasbud!
To use
order.billing_phone
placeholder, 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.
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.
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\Integrator
in 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 1 year, 7 months 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/init
a 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 );
Hi @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,
BartekHi @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 1 year, 7 months ago by Bartek.
Forum: Plugins
In reply to: [Recover Abandoned Carts for WooCommerce by ShopMagic] Cart link not workingHi @nymla
{{ cart.link }}
will not produce a clickable link, only a raw form of HTML link. This way you have the flexibility to use it the way you want, e.g., to make a clickable link with text ‘Return now’, you could wrap it in HTML markup<a href="{{ cart.link }}">Return now</a>
As to using images of products, you can use
{{ cart.items | template: 'grid_2_col' }}
placeholder. This will output images in a grid of 2 items per row. There’s also a 3_col variant. You can see the settings for yourself by clicking the placeholder name in automation editor sidebar – the popup with placeholder description and options will appear.Best regards,
BartekHi @kaiyang
This can be handled with our free extension to ShopMagic – Abandoned Carts. After activation, is settings, you will have an option to enable exit-popup for customers. It’s not entirely what you are asking for, but I hope this functionality covers your need.
Hi @zappob
I really am sorry to hear that. Across 3.0.7 and 3.0.12 there shouldn’t be any changes with regard to saving settings.
We will investigate the issue and keep you posted on any updates.
Best regards,
Bartek