php – trying to hide a “0” value from a HTML display

enter image description hereIs there any way to hide an HTML field based on the displayed value of “0”
I have an ecomm site that displays Quantity available with a numeric value.
I only want to display the number if it is above “0”
The values are populated from data base upload to the site.
The “0” value is NOT an input field. so most codes I see have the solution with some sort of input condition code.

My site displays this: Call for Availability.0
If item has QTY above “0” it displays this: Qty On Hand: 1708
I need to remove the “0” and only display Call for Availability.

I have researched similar request on this forum and found all have answers using an input field. The problem is the “0” is not an input. It is an code generated inventory amount.

I have tried CSS to hide the value, but that hides ALL the values including above “0”.

I can insert any form of code needed. Java, PHP, json, etc…

Here is a sample of actual code I have:

<div id="availabilityInfo" class="availabilityInfo"> 
<span class="availability-header">[product_Header-availability]</span> <span id="availability" class="product_availability availability-item">[availability]</span> 
<span style="display: inline;" id="product_inventory">[stock]
<span class="freeshipping availability-item"><!--[freeshipping]--></span> 
</span></div>

The [STOCK] tag is what brings in the qty value of “0”

magento2 – Hide Default all Tab in product Edit except one custom

I want to hide the products tab and show only one tab in the product add time for a particular admin role for this I used the below code.

Admin di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="MagentoCatalogUiDataProviderProductFormModifierPool">
        <arguments>
            <argument name="modifiers" xsi:type="array">
                <item name="advancedCustomOptions" xsi:type="array">
                    <item name="class" xsi:type="string">(Vendor)ProductTabUiDataProviderProductForm</item>
                    <item name="sortOrder" xsi:type="number">20</item>
                </item>
            </argument>
        </arguments>
    </virtualType>
</config>

UI File

app/code/(Vendor)/ProductTab/Ui/DataProvider/ProductForm.php

Code

public function modifyMeta(array $meta)
{   
    if (trim($roleData('role_name')) == self::REPAIR_TRACKER_ROLE_NAME) {
            $meta("customTab_1") =$meta("customTab_2")=$meta("customTab_3")=$meta("customTab_4")=$meta("customTab_4")=$meta("search-engine-optimization")= (
                "arguments" => (
                    "data" => (
                        "config" => (
                            "componentType" => "fieldset",
                            "collapsible" => false,
                            "sortOrder" => 1,
                            'opened' => false,
                            'canShow' => false,
                            'visible' => false
                        )
                    )
                )
            );
        }
    }

  return $meta;
}

But it’s hiding my customer which added by code but I want to hide all tab except one custom tab which can admin can use. But when I removed the default tab then it’s not removing also it’s not showing any error

How can I hide all the mixes on YouTube?


Your privacy


By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.




magento2.4.2 – Magento 2.4.2 How to hide duplicate pictures when the product color is switched

The code responsible for concatenating the images on product page is:

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js#L1290

The value this.options.gallerySwitchStrategy can be changed to ‘replace’ to avoid configurable product images be merged to the simple product images.

In order to do that you can change the value of gallery_switch_strategy on the theme view.xml file:

https://github.com/magento/magento2/blob/2.4-develop/app/design/frontend/Magento/luma/etc/view.xml#L266

You must change it on your theme:

app/design/frontend/Angelo/theme/etc/view.xml

magento2 – Magento 2: Hide price from the upsell and related products block


Your privacy


By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.




event receivers – Hide “Replace” button from SharePoint Online


Your privacy


By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.




9 – Using jQuery to hide fields in a view

I have several parent and child taxonomy vocabulary terms in a content view. I would like to hide all of the unrelated child terms when a certain parent is selected. Is there a way I can do this via a jQuery script? Here’s what I have so far.

<script>
(function ($, Drupal, drupalSettings) {

  'use strict';

  Drupal.behaviors.hideFields = {
   attach: function (context, settings) {
         if ($('.views-exposed-form-page-1#edit-tid--TID').attr("selected, selected")) {
                    $('#NID(value=" + City + ")').hide();
        }
    }
 }
}(jQuery));
</script>

wordpress – Hide products linked to a Membership while having that certain membership in Woocommerce

I have 2 Woocommerce Subscription Products called:

  • Bronze Membership (Monthly Subscription linked to a “Bronze Membership” in Woocommerce Memberships)
  • Silver Membership (Monthly Subscription linked to a “Silver Membership” in Woocommerce Memberships)

I can restrict products to these memberships with no problem, but in case of one customer purchase the Bronze Membership Subscription, when he goes to my store, he can’t see the Bronze Membership but he can see the Silver one., and if he has the Silver one, he can’t see the silver one but can see the bronze one in case he wants to downgrade his sub.

Isn’t there a way to hide the membership subscription product if the customer has an active membership?

partitioning – How do I hide singularity squashfs partitions in Nautilus

Notice the 2.5GB and 5.1GB volumes shown below, they are singularity mounted instances. I don’t remember seeing them on 18.04 nautilus, but I do see them in 20.04 (Fresh install). Is there any option in gnome-disks to hide partitions? How do I hide all such partitions mounted by singularity?

PS: I also wish I can hide thinclient_drives :p which I see in RDP sessions.

enter image description here

wp config – Get WP CLI to hide debug warnings and notices in JSON output, same setting as website

Summary: WP CLI can be used to get a JSON output of all the plugins installed on a site, but the output gets corrupted due to warnings although log levels are set to low.

Problem

Unfortunately, I have a site that runs an outdated plugin producing some warnings. They are not shown on the website, as WP_DEBUG is set to false in wp-config.php. The website runs fine, because there are no fatal errors. WP CLI produces the correct JSON results, too, but prepends all output with a particular warning. Actually it’s the same warning twice, the first instance being prepended with PHP Warning:.

The command I’m running

wp plugin list --fields=name,status,update,version,update_version,title --format=json

Current output

PHP Warning:  Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance) in /sites/(redacted)/files/wp-content/plugins/ajax-event-calendar/inc/widget-contributors.php on line 61
Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance) in /sites/(redacted)/files/wp-content/plugins/ajax-event-calendar/inc/widget-contributors.php on line 61
({...JSON omitted for brevity...})

This is my wp --info

OS: Linux 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 x86_64
Shell:  /bin/bash
PHP binary: /usr/bin/php7.4
PHP version:    7.4.3
php.ini used:   /etc/php/7.4/cli/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 14.14 Distrib 5.7.34, for Linux (x86_64) using  EditLine wrapper
SQL modes:  
WP-CLI root dir:    phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:  phar://wp-cli.phar/vendor
WP_CLI phar path:   /sites/(redacted)/files
WP-CLI packages dir:    
WP-CLI global config:   /sites/(redacted)/.wp-cli/config.yml
WP-CLI project config:  
WP-CLI version: 2.5.0

Attempts at a solution

I read

And following that, I changed two settings in /etc/php/7.4/cli/php.ini.

  • error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT -> error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
  • log_errors = On -> log_errors = Off

But this only got rid of the first instance of the warning, so that the output looks like this now:

Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance) in /sites/(redacted)/files/wp-content/plugins/ajax-event-calendar/inc/widget-contributors.php on line 61
({...JSON omitted for brevity...})

Question

I have no idea where else I could look and I’m truly wondering why it seems impossible to apply the same error reporting levels to WP CLI that are already being applied to the website itself?

I am aware that I can simply fix the error in the plugin or try to get rid of it (since it probably isn’t secure anymore either…). But just for the sake of knowing a solution to this issue, should it happen again in the future, I’m happy to hear any thoughts.