get_product($product->ID);
//posso usare l'id con lo shortcode oppure con la classe che modella il singolo prodotto
$shortcode = do_shortcode('[product_page id="'.$product->id.'"]');
$shortcode_parse = str_get_html($shortcode);
$shortcode_parse->find('.product form',0)->attr['action'] = 'cart.php';
// cambio i link alle categorie
foreach($shortcode_parse->find('.posted_in a') as $element)
$element->href = 'category.php'.substr($element->href, strpos($element->href, "/?") + 1);
// cambio i link che portano alla pagina del prodotto (anche quello del add to cart button) ad esempio i related product alla fine della pagina prodotto
foreach($shortcode_parse->find('.products a') as $element)
$element->href = 'product.php'.substr($element->href, strpos($element->href, "/?") + 1);
// cambio il link dell add to cart button
foreach($shortcode_parse->find('.product_type_simple') as $element)
$element->href = 'cart.php?'.substr($element->href, strpos($element->href, "?") + 1);
//$element->href = str_replace ('product.php', 'cart.php', $element->href);
?>
FREE SUPPORT
CALL OR TEXT US AT:
1 (516) 754-1470
If there is no answer please leave a message and we will call you back within 24 hours.
WHAT WE DO
We sell Korg and Yamaha beats from the top programmers for the lowest prices on the web. Our programmers work hours on each beat so that you have the best quality sound and keep your Simcha rolling.