Title: Quickbuy button shortcode
Last modified: April 1, 2020

---

# Quickbuy button shortcode

 *  Resolved [Sirion89](https://wordpress.org/support/users/sirion89/)
 * (@sirion89)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/quickbuy-button-shortcode/)
 * Hi,
    i updated this plugin from 1.8 to 2.4, all went smooth except one shortcode
   i was using:
 * [wc_quick_buy label=”BUY” product=”‘ . $product->get_id() . ‘” qty=”1″ type=”
   button” htmlclass=”single_add_to_cart_button” css_class=”single_add_to_cart_button”]
 * I tried to use both “htmlclass” and “css_class” after digging into your code 
   because my prev shortcode had just the “css_class” attribute.
    After i couldn’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:
 *     ```
       protected function defaults() {
       			return array(
       				'label'        => Helper::option( 'button_label' ),
       				'product'      => false,
       				'qty'          => Helper::option( 'quantity', 1 ),
       				'hide_in_cart' => Helper::option( 'hide_if_in_cart' ),
       				'css_class'    => Helper::option( 'css_class' ),
       			);
       		}
       ```
   
 * Later on in the same file inside output function you have this:
 *     ```
       $instance = new Button_Generator( array(
       							'type'         => 'link',
       							'product'      => $shortcode_product,
       							'qty'          => $this->option( 'qty' ),
       							'label'        => $this->option( 'label' ),
       							'hide_in_cart' => $this->option( 'hide_in_cart' ),
       							'class'        => $this->option( 'htmlclass' ),
       						) );
       						return $instance->html();
       ```
   
 * As you can see you are looking for “htmlclass” inside the options, but you should
   instead look for “css_class”. 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?
 * Thank you for your amazing plugin!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Varun Sridharan](https://wordpress.org/support/users/varunms/)
 * (@varunms)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/quickbuy-button-shortcode/#post-12625745)
 * Hi
 * The issue is fixed in V2.5
 *  Thread Starter [Sirion89](https://wordpress.org/support/users/sirion89/)
 * (@sirion89)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/quickbuy-button-shortcode/#post-12633120)
 * Thank you for the hyper-quick fix 😀
 * Cheers
    -  This reply was modified 6 years, 1 month ago by [Sirion89](https://wordpress.org/support/users/sirion89/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Quickbuy button shortcode’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-quick-buy/assets/icon-256x256.jpg?rev=2157616)
 * [Quick Buy For Woocommerce](https://wordpress.org/plugins/woocommerce-quick-buy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-quick-buy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-quick-buy/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-quick-buy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-quick-buy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-quick-buy/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Sirion89](https://wordpress.org/support/users/sirion89/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/quickbuy-button-shortcode/#post-12633120)
 * Status: resolved