Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Remove everything but add to cart form from product page shortcode
- function clean_woocommerce_page($html){
- $dom = new DOMDocument;
- $dom->loadHTML( $html );
- $xpath = new DOMXPath( $dom );
- //Remove Tabs
- $tabs = $xpath->query(".//div[@class='woocommerce-tabs'] | .//div[@class='images'] | .//h1");
- foreach ( $tabs as $div ) {
- $div->parentNode->removeChild( $div );
- }
- return $dom->saveHTML();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement