{"id":12613133,"date":"2020-04-01T16:55:23","date_gmt":"2020-04-01T16:55:23","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/quickbuy-button-shortcode\/"},"modified":"2020-04-01T16:55:23","modified_gmt":"2020-04-01T16:55:23","slug":"quickbuy-button-shortcode","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/quickbuy-button-shortcode\/","title":{"rendered":"Quickbuy button shortcode"},"content":{"rendered":"<p>Hi,<br \/>\ni updated this plugin from 1.8 to 2.4, all went smooth except one shortcode i was using:<\/p>\n<p>[wc_quick_buy  label=&#8221;BUY&#8221; product=&#8221;&#8216; . $product-&gt;get_id() . &#8216;&#8221;  qty=&#8221;1&#8243; type=&#8221;button&#8221; htmlclass=&#8221;single_add_to_cart_button&#8221; css_class=&#8221;single_add_to_cart_button&#8221; ]<\/p>\n<p>I tried to use both &#8220;htmlclass&#8221; and &#8220;css_class&#8221; after digging into your code because my prev shortcode had just the &#8220;css_class&#8221; attribute.<br \/>\nAfter i couldn&#8217;t get it to work, i went again inside your code and find in this file wp-content\/plugins\/woocommerce-quick-buy\/includes\/shortcodes\/class-button.php the following:<\/p>\n<pre><code>protected function defaults() {\n\t\t\treturn array(\n\t\t\t\t&#039;label&#039;        =&gt; Helper::option( &#039;button_label&#039; ),\n\t\t\t\t&#039;product&#039;      =&gt; false,\n\t\t\t\t&#039;qty&#039;          =&gt; Helper::option( &#039;quantity&#039;, 1 ),\n\t\t\t\t&#039;hide_in_cart&#039; =&gt; Helper::option( &#039;hide_if_in_cart&#039; ),\n\t\t\t\t&#039;css_class&#039;    =&gt; Helper::option( &#039;css_class&#039; ),\n\t\t\t);\n\t\t}<\/code><\/pre>\n<p>Later on in the same file inside output function you have this:<\/p>\n<pre><code>$instance = new Button_Generator( array(\n\t\t\t\t\t\t\t&#039;type&#039;         =&gt; &#039;link&#039;,\n\t\t\t\t\t\t\t&#039;product&#039;      =&gt; $shortcode_product,\n\t\t\t\t\t\t\t&#039;qty&#039;          =&gt; $this-&gt;option( &#039;qty&#039; ),\n\t\t\t\t\t\t\t&#039;label&#039;        =&gt; $this-&gt;option( &#039;label&#039; ),\n\t\t\t\t\t\t\t&#039;hide_in_cart&#039; =&gt; $this-&gt;option( &#039;hide_in_cart&#039; ),\n\t\t\t\t\t\t\t&#039;class&#039;        =&gt; $this-&gt;option( &#039;htmlclass&#039; ),\n\t\t\t\t\t\t) );\n\t\t\t\t\t\treturn $instance-&gt;html();<\/code><\/pre>\n<p>As you can see you are looking for &#8220;htmlclass&#8221; inside the options, but you should instead look for &#8220;css_class&#8221;. Indeed after modifying your code all was working again for me. Unfortunatly your plugin kinda lack of apply_filters so i had no other way to make it work. Would it be possibile for you to fix it in the next release?<\/p>\n<p>Thank you for your amazing plugin!<\/p>\n","protected":false},"template":"","class_list":["post-12613133","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12613133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12613133\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12613133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}