Home › Forums › WoodMart support forum › shop page shortcode
shop page shortcode
- This topic has 8 replies, 3 voices, and was last updated 2 years, 12 months ago by Elise Noromit.
-
AuthorPosts
-
November 24, 2021 at 9:57 pm #334356
ShibaParticipantHi, I’ve just bought the second license. The product filter feature is really great but unfortunately after hitting the filter buton, it redirects to the result in the shop page.
However, I want to embed the shop page in another page as I want to use the shop filter feature so that it will not redirect to the shop page. I’ve enabled the shop filter in the theme settings and tried to create a shortcode of the shop page. Here is the code but it’s not working.
add_action('init', 'add_shortcodes'); function add_shortcodes(){ add_shortcode ('shop-filter', 'shortcode_shop_filter'); } function shortcode_shop_filter () { wc_get_template ('woocommerce/archive-product.php'); }
[shop-filter]
AND
function my_filter_shortcode() { ob_start(); get_template_part('woocommerce/archive-product.php'); return ob_get_clean(); } add_shortcode( 'shop-filter', 'my_filter_shortcode' );
[shop-filter]
Can you please help me with this?
November 25, 2021 at 9:17 am #334435
Aizaz Imtiaz AwanKeymasterHello,
Sorry but we could not help with code customizations.
This is beyond our limitations and support policy.
Best Regards
November 25, 2021 at 10:11 am #334450
Elise NoromitMemberHello,
You can create any page and set as the shop page in the Woocommerce > Settings > Products. Then you can add filters in the Appearance > Customize > Widtets > Shop page widget area.
In addition, you can enable AJAX Shop not to reload the whole page when you filter products. You can find this option in Theme Settings > Shop.
If you have any questions please feel free to contact us.
Best Regards
November 25, 2021 at 7:31 pm #334641
ShibaParticipantHi,
You can create any page and set as the shop page in the Woocommerce > Settings > Products. Then you can add filters in the Appearance > Customize > Widtets > Shop page widget area.
–> Sorry, I don’t understand what you mean. It may not be what I want to achieve.
In addition, you can enable AJAX Shop not to reload the whole page when you filter products. You can find this option in Theme Settings > Shop.
–> There’s no such option there. If you mean Ajax shop, yes, it’s located in the Theme setings > Product Archive. I already enabled this option and it shows above the products in the shop page. So, I can use this filter to filter the product there, which is great.
Let me explain more about what I want to achieve.
– I insert the Product Filters element, which comes with the theme elements, into WPbakery row. But it just shows the filter alone without any products below it like in the shop page. When I select the filter option in the dropdown and hit the filter button, it redirects to the filter result in the shop page. This is not the behavior I want.
I have enabled the Ajax shop option, which is located in Theme setings > Product Archive. And it displays above the products in the shop page. When I use this filter option there, it filters the products wthout reloading the page as it uses ajax. This is what I want. So, I need this filter behvaour in this shop page to be displayed in the row in my home page. I have done some research to work around but not succeed. The only thing would be to create a shortcode of the shop page and insert it in the row in my home page. That’s why I open the ticket to ask you to help. But I don’t mind if it’s beyond the support policy. But I would suggest you to improve the Product Filters element to be able to filter it like in the shop page where the filter is above the products and when you filter them, the ajax filter result immediately displays.
November 26, 2021 at 12:32 pm #334869
Elise NoromitMemberHello,
The custom filters work in the way you have described and they cannot be changed. The custom filters are designed to put them on any page. As you know the Woocommerce filter never works on WordPress pages.
The shop page does not have any shortcodes. You just create an empty page and set it in the Woocommerce settings.
You will have to customize Woocommerce considerably to achieve your goal, and such customization is not covered by our support.
Best Regards
November 26, 2021 at 1:25 pm #334895
ShibaParticipantiframe is not working with your theme? I’ve tried to wuse iframe as below:
<iframe src="http://www.mysite.com/shop" frameborder="0" allowfullscreen="allowfullscreen"><iframe>
but it doesn’t work with your theme. I embed this code into the WPBakery raw html but it doesn’t work. The result is that after the page reloads slowly, some other elements I add in WPBakery rows disapear, and only your filter displays, no any products below it.
However, after I switch to Twenty Twenty one theme, it works. You can try at your end.
November 26, 2021 at 1:54 pm #334913
ShibaParticipantOne more issue is that after I swtich to Twenty twenty one and switch back to your theme again, the element Product filters and Section Divider are broekn as you cans ee in the attached screenshot. So, I lose my settings, have to set it again.
Attachments:
You must be logged in to view attached files.November 26, 2021 at 6:13 pm #334973
ShibaParticipantI just forget to use https. Now working properly.
November 26, 2021 at 9:49 pm #334997
Elise NoromitMemberThat is fine.
If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
The topic ‘shop page shortcode’ is closed to new replies.
- You must be logged in to create new topics. Login / Register