Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add categories name to Algolia #158

Open
w3bdesign opened this issue Apr 18, 2022 · 1 comment
Open

Add categories name to Algolia #158

w3bdesign opened this issue Apr 18, 2022 · 1 comment
Assignees

Comments

@w3bdesign w3bdesign self-assigned this Apr 18, 2022
@w3bdesign
Copy link
Owner Author

	$get_categories = explode(',', wp_strip_all_tags(wc_get_product_category_list($product->get_id()), false));

            preg_match('/<img(.*)src(.*)=(.*)"(.*)"/U', $product->get_image(), $result);
            $product_image = array_pop($result);

            $record['objectID']               = $product->get_id();
            $record['product_name']           = $product->get_name();
            $record['product_image']          = $product_image;
            $record['short_description']      = $product->get_short_description();
            $record['regular_price']              = $regular_price;
            $record['sale_price']                   = $sale_price;
            $record['on_sale']                        = $product->is_on_sale();
            $record['categories']                   = $get_categories;
            $records[] = $record;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant