I want to show in-stock products at first on product catalog

Pending
REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme March 16, 2021
Login to reply
Igor Sunz Support Agent
5 days ago

please, update your support first if you need customization help. Without support, you can expect only help with bug reports. Thank you for understanding that our time has price

KRGKART Kolkata
5 days ago

Hi,

I am trying to show Instock products at first for related products for
this, I have added the following code in the function.php file but it's not
working for all categories products.


*Not working* categories products, please check any products from this
category: https://www.krgkart.com/product-category/laptops/
*Working* category, please check any products from this category:
https://www.krgkart.com/product-category/processor/


Please suggest to me how to fix this,

I know my support is ended but I am trying to fix this issue from the
beginning, please help me.

Code:
















*add_filter( 'woocommerce_related_products',
'mysite_filter_related_products', 10, 1 );function
mysite_filter_related_products( $related_product_ids ){if (!is_admin()) {
foreach ($related_product_ids as $key => $value) { $relatedProduct
= wc_get_product($value); if (!$relatedProduct->is_in_stock() ) {
unset($related_product_ids["$key"]); } } return
$related_product_ids; }}*

Igor Sunz Support Agent
1 month ago

https://wpsoul.com/how-optimize-speed-of-wordpress/


Сб, 14 авг. 2021 г. в 13:59, Sizam Support Help Desk <
sizamtheme+E9PZbBO4GWEo4XVWYk0y@mail.support-hub.io>:

KRGKART Kolkata
1 month ago

Hello,

My site product page speed is good for desktops on google page speed
insights but for mobile pages, speed rank is very low. This is happening
from the beginning when I have purchased the theme.

Please refer to the attached images for the page speed. And please suggest
to me, how do I increase my page speed for both mobile & desktop.

I am using DegitalOcean (4 core CPU, 8 GB memory, 50 GB SSD)

Website: https://www.krgkart.com/
Product Page URL:
https://www.krgkart.com/product/lenovo-ideapad-slim-3i-15-6-inch-fhd-laptop/

Mobile
[image: image.png]
Desktop
[image: image.png]

Igor Sunz Support Agent
1 month ago

you can try hook

rhwoo_template_single_add_to_cart

KRGKART Kolkata
1 month ago

Hello,

Ok, I have got my function working, only I need the right hook.

I am looking for the hook that displays my shortcode in " After Button
Area". Please help me.

Here is my function

add_action('*woocommerce_after_add_to_cart_button*',
'show_emi_option_popup');
function show_emi_option_popup(){
global $product;
if($product->get_sale_price() >= 10000){
echo do_shortcode('my-shortcode');
}
}

[image: image.png]

Igor Sunz Support Agent
1 month ago

There is no such shortcode, but you can make own function

https://www.google.com/search?q=conditional+price+shortcode+woocommerce

https://rehubdocs.wpsoul.com/docs/rehub-theme/child-themes/how-to-customize-your-theme/


Чт, 5 авг. 2021 г. в 10:50, Sizam Support Help Desk <
sizamtheme+E9PZbBO4GWEo4XVWYk0y@mail.support-hub.io>:

KRGKART Kolkata
1 month ago

Hello,

I want to add one shortcode on *Theme option – shop settings – Custom code
areas *

I got one conditional shortcut option on your blog to display shortcode on
the product page based on product categories.
[image: image.png]

I want to show a shortcode on the product page based on the product price,
If the product price is greater than 10000 shortcode will display on the
product page otherwise it will not display.

KRGKART Kolkata
1 month ago

Hello,

Thanks for your email, it was my mistake I have done some mistakes in logo
settings now it's showing correctly.

Igor Sunz Support Agent
1 month ago

Your screenshot doesn’t show any problem. Also you missed to attached screenshot of settings for your logo from theme options 

KRGKART Kolkata
1 month ago

Hello,

I have changed my site logo and after that, I am facing a logo display
issue on the Chrome (desktop) browser. My site logo is showing dull on
chrome browser. But on firefox & other browsers, it's showing correctly.

I have done all cache clearing tasks, but the issue is still not resolved.

Please check the attached screenshots and help me to solve this issue ASAP.

Igor Sunz Support Agent
5 months ago
KRGKART Kolkata
5 months ago

Hi,

I want to show *instock* products *at first* on the *related products*
option, how to do this? *please help*.

[image: image.png]

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Igor Sunz Support Agent
5 months ago

There is no such filter. But you can create attribute, name it “brand”,
then use regular attribute filter

Пт, 19 марта 2021 г. в 11:24, Sizam Support Help Desk <
sizamtheme+E9PZbBO4GWEo4XVWYk0y@mail.support-hub.io>:

KRGKART Kolkata
5 months ago

Thank you for your kind support.

I want to add brand (store) filter on product category pages, is it
possible? if yes then how to add this please help.

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Igor Sunz Support Agent
6 months ago

add also

add_filter( 'rh_module_args_query', 'mihanwp_sort_by_stock', 9999 );

KRGKART Kolkata
6 months ago

Hi, 

I want to show in-stock products at first on every product catalog, for that I have added following code at my function.php file, its working fine on category pages but its not working on brand (store) pages, and related products and also on some sort by options like price low-high & popularity, is there any way to solve it, please help.


code: 

add_filter( 'woocommerce_get_catalog_ordering_args', 'mihanwp_sort_by_stock', 9999 );

function mihanwp_sort_by_stock( $args ) {

   $args['orderby'] = 'meta_value';

   $args['order'] = 'ASC';

   $args['meta_key'] = '_stock_status';

   return $args;

}

Additional Info

Link on page with issue: https://www.krgkart.com/brand/corsair/