$result .= '<div class="dp-list-price dp-price">' . $product->get_price_html() . '</div>'; } $result .= '<div class="dp-stock"></div>'; if (in_array('button', $enable)) { switch ($dp_addtocartbutton['type']) { case 'buttonquantity': ob_start(); woocommerce_template_single_add_to_cart(); $result .= ob_get_contents(); ob_end_clean(); break; case 'productDetail': $result .= '<div class="dp-grid-button">' . dp_add_to_cart_productdetail(get_permalink(), $addtocarttext) . '</div>'; break; case 'customButton': $result .= '<div class="dp-grid-button">' . dp_add_to_cart_customButton($addtocarturl, $addtocarttext) . '</div>'; break; case 'customText': $result .= '<div class="dp-grid-button">' . dp_add_to_cart_customText($addtocarturl, $addtocarttext) . '</div>'; break; default: $result .= '<div class="dp-grid-button">' . dp_add_to_cart() . '</div>'; break; } } //$button Show / Hide $result .= '</div>'; } $result .= '</div>'; } $result .= '</div>';
case 'button': $result .= '<div class="dp-stock"></div>'; switch ($dp_addtocartbutton['type']) { case 'buttonquantity': ob_start(); woocommerce_template_single_add_to_cart(); $result .= ob_get_contents(); ob_end_clean(); break; case 'productDetail': $result .= '<div class="dp-grid-button">' . dp_add_to_cart_productdetail(get_permalink(), $dp_addtocartbutton['custom_text']) . '</div>'; break; case 'customButton': $result .= '<div class="dp-grid-button">' . dp_add_to_cart_customButton($dp_addtocartbutton['custom_url'], $dp_addtocartbutton['custom_text']) . '</div>'; break; case 'customText': $result .= '<div class="dp-grid-button">' . dp_add_to_cart_customText($dp_addtocartbutton['custom_url'], $dp_addtocartbutton['custom_text']) . '</div>'; break; default: $result .= '<div class="dp-grid-button">' . dp_add_to_cart() . '</div>'; break; } //$button Show / Hide break; } } $result .= '<div style="clear: both;"></div></div>'; $result .= '</div>'; $item++; } $result .= '</div>';