I want to change following code from Elementor:
$this->add_render_attribute( 'button',
[
'rel' => 'nofollow',
'href' => $product->add_to_cart_url(),
'data-quantity' => ( isset( $settings['quantity'] ) ? $settings['quantity'] : 1 ),
'data-product_id' => $product->get_id(),
'class' => $class,
]
);
to add new value like this:
foreach (get_the_terms(get_the_ID(), 'producer') as $cat) {
echo $cat->name;
}
for the 'href' part in first code:
'href' => $product->add_to_cart_url(),
above 'href' code adds this value in path ?add-to-cart=2809 and I want to make it look like this ?add-to-cart=2809&wdm_name=MY-CODE-FOR-EACH-ABOVE-CREATE-VALUE-HERE
How do I implement second code inside HREF part so I dont get the error.
Thanks