Issue with UPCs
-
I’m running Relevanssi on a Flatsome themed site and also using the Product GTIN (EAN, UPC, ISBN) for WooCommerce plugin and I’m having an issue with variable products for some reason.
Flatsome’s AJAX search will pull parent products based off of UPC codes but it won’t pull children/variations for some reason. I tried running an admin search on a variable UPC and it pulls it up there so I’m not exactly sure what the disconnect is. I’m running the following snippet for Relevanssi to pull SKUs for variable products so I’d imagine it just needs something similar for UPCs, are you able to offer any insight on this please?
// RELEVANSSI VARIABLE SKU SEARCH add_filter('relevanssi_content_to_index', 'rlv_index_variation_skus', 10, 2); function rlv_index_variation_skus($content, $post) { if ($post->post_type == "product") { $args = array('post_parent' => $post->ID, 'post_type' => 'product_variation', 'posts_per_page' => -1); $variations = get_posts($args); if (!empty($variations)) { foreach ($variations as $variation) { $sku = get_post_meta($variation->ID, '_sku', true); $content .= " $sku"; } } } return $content; }
Also another issue that I’m having is that Flatsome’s AJAX search will pull SKUs correctly but if I just hit enter instead of letting the AJAX results load then it takes me to the shop page and says no products found. I’m running Search & Filter Pro for my shop page if that gives you any insight.
Any info you’re able to provide on either of these issues would be incredibly appreciated, thank you for your time.
- The topic ‘Issue with UPCs’ is closed to new replies.