-1

I have created a widget here https://gist.github.com/joshbenham/e03c35313282c6ac402a

For some reason when WooCommerce is enabled it will not save the extra fields (greatest, great and good).

I have disabled WooCommerce. Changed products to just be posts. Tested and it works perfectly.

Has anyone run into this problem before? The weirder thing is that it actually does save the title just none of the other fields. It does not even save them as blank. They just get cut out full stop.

0

Woocommerce already has a widget called best_sellers, which is conflicting with the name you're using, and it's making your widget use the Woocommerce widget update function. Since that one also has a field called title, that field is still saving.

Add in a prefix to best_sellers in your construct function to fix the problem:

public function __construct() {
    $widget_options = array(
        'classname' => 'best_sellers',
       'description' => 'A list of products that are your best sellers'
    );
    parent::__construct("my_best_sellers", "Best Sellers", $widget_options);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.