Jump to content


Replying to Super Widget Product Id Filter


Post Options

  or Cancel


Topic Summary

ironbound

Posted 28 April 2014 - 05:07 PM

Thanks so much Lew!

lewayotte

Posted 28 April 2014 - 06:48 AM

Hey Tim,

That makes sense. I've added this filter to core, on the else part of that conditional. I think that'll suit your needs.

$product_id = apply_filters( 'it_exchange_super_widget_empty_product_id', false );

Should be released with the next version we push out.

Let me know if you have any questions.

Lew

ironbound

Posted 26 April 2014 - 09:12 PM

Hi Guys,

We really need a filter in this part of the super widget to allow us to change the product ID.

if ( ! empty( $GLOBALS['wp_query']->queried_object->ID ) && it_exchange_get_product( $GLOBALS['wp_query']->queried_object->ID ) )
$product_id = $GLOBALS['wp_query']->queried_object->ID;
else
$product_id = false;

We need this so that we can embed a super widget on a non-product page.

Either that or set product ID as a class property, so we can extend that class, and provide our own product ID in the constructor.


Or am I missing something entirely, and there already exists a way to embed a super widget?


Anyways, this would be immensely helpful as we need it soon for a client project.

If this wouldn't make it in soon, if you could let me know that as well, so I can start working on a crazy work around :)

Thanks!
Tim

Review the complete topic (launches new window)