I'm using car66 plugin in my wordpress site and I want to use the plugin's shortcode to add items into the cart. I don't know how to call a shorcode in a page. The short code is supposed to generate a button that allows the user to add items into the cart. However it is not adding into the cart. Please help me. My code is here. Please help. [add_to_cart item="EX-29"]
I figured out to use the do_shortcode inbuilt function. For example I used echo do_shortcode("[add_to_cart item=\"EX-29]\""); and it worked.
Related
I am having an issue finding any way to display a single post on the woocommerce checkout specifically on a payment plugin, I use other shortcodes in these gateways and they work perfectly.
However when I try using some display post shortcodes it doesn’t work at all and instead shows up as text.
Example of my issue - i edit and put in the shortcode [display-posts] and instead of displaying the posts it simply displays [display-posts].
I have tried using multiple shortcode plugins and even tried creating my own. The main one I have tried to use is [display-posts] with the plug-in. I always put it in my themes functions.php as well!
I have tried these short codes on the regular Wordpress pages that I have that are published and have found I have the same issue, so I don’t believe it’s the placement I want the shortcode to appear at. Can anyone help me with this?
To make all the posts display you can create a custom shortcode and the shortcode which you are using is [display-posts] is not default WordPress in build shortcode. To have your same shortcode run please install the below plugin: https://wordpress.org/plugins/display-posts-shortcode/
Then you [display-posts] shortcode will work or another solution is custom shortcode as I mentioned above.
Please let me know if find any issues.
Thanks.
I need to add a section of boilerplate text about shipping info to the end of the WooCommerce single product page, right after the SKU and Categories. I would like to do this via hook if possible so I don't have to modify any WooCommerce code/template. The theme that I'm working with (Divi) has bunches of code already in functions.php, so I'd also like to avoid modifying that file, too.
My specific question is "what's the best place to add a WC hook for this purpose?" I know I could create a child theme and in its functions.php add a WC hook, but then I'd have the problem of calling in the original theme's functions.php (I don't know how to do that). Or is there a better way?
Try to create your own plugin
https://codex.wordpress.org/Writing_a_Plugin
I made a simple WordPress theme which I'm testing locally. I got a Instagram feed plugin which gives me a shortcode to add anywhere on my blog/theme. The problem is, the shortcode does not display the feed or anything for that matter but I can see the feed's code (div) when I check the page source code. Other shortcode works but not this one. The Instagram feed works on other themes but not mine. I've tried almost all the online solutions (add_filter, do_shortcode etc) but none works.
I'm sure the problem is not in the shortcode or plugin because it works on other themes and maybe there is some problem with my theme. I had also made a WordPress theme before and the feed doesn't work even in that. I don't what code to show because I really don't the where the problem is in my theme. Any help will be appreciated.
Edit:
The shortcode is [instashow id="2"]
I've tried adding that to a page but that doesn't work. I've also tried adding <?php echo do_shortcode('[instashow id="2"]'); ?> in the template itself but that doesn't work either.
You checked to see if the plugin settings are correct?
The next step would be to check other shortcodes in other plugins to see if other shortcodes work or have problems too.
First you have to make sure if the problem is caused by the theme or the plugin.
So I'm working on this website and I'm using the woocommerce plugin.
The plugin is working fine and I can add things to my cart the only problem is that I can't view my cart. The image I've added shows my "Cart" page and you can see it just simply shows the shortcode.
http://gyazo.com/f0710eeb2fd63643bb74607988559e02
I have no idea why it isn't working :(
I found out what was wrong, I had to add this little bit of code in the page.php file:
<?php
echo apply_filters('the_content',$wp_query->post->post_content);
?>
Hope it will help anyone else too :)
I've come across this issue this week. I found that deleting the cart page and regenerating it with Woocommerce fixed it.
Go to Woocommerce > Settings > Utilities > "Create default WooCommerce pages"
I created a wordpress plugin and I added shortcode feature to it.
but i want to execute only one shortcode and prevent applying of multiple shortcodes if the administrator did so.
thanks.
You may find what you need here:
https://wordpress.stackexchange.com/questions/40733/check-for-shortcode-in-post-pages-and-widgets-and-template-files
However please note that if you allow only one shortcode to run, if your client installs a plugin that used shortcodes this will not work.
Why you need this anyway? Maybe we can find a better solution :)