few questions before pro

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #180903
    Ned
    Participant

    Hi there,
    1. can it filter based on the new woocommerce brands feature?
    2. Can it replace some values. For example woocommerce stok status is “in_stock” but i need to put “in stock” for some reasons

    #181087
    Taha
    Moderator
    Plugin Support

    Hi Ned,

    Thanks for your questions.

    Both points are supported.

    1. Filtering by WooCommerce Brands
    Since the new WooCommerce Brands feature is registered as a taxonomy, the plugin can filter products by brand directly in the feed conditions. You can use the “Custom taxonomy to include” option and set the taxonomy to:

    product_brand

    Then specify the brands you want included (e.g. lenovo,samsung,apple).
    This will limit the feed to products that belong to those brands.

    If you also need to output the brand in the feed, you can use the shortcode:
    [alg_product_terms taxonomy="product_brand"]

    2. Adjusting the stock status value
    You can control the stock availability output using the built-in shortcode:

    [alg_product_stock_availability remove_number="yes"]

    This outputs “In stock” instead of in_stock.

    If you need the exact format “in stock”, you can use the built-in find-and-replace option:

    [alg_product_stock_availability find="In stock" replace="in stock"]

    No custom code or hooks are required for either case.

    Let us know if you need help configuring the feed.

    Best regards

    #181175
    Ned
    Participant

    thanks for reply.
    Is it able to handle 10K products, choose only in stock and finish and xml file with 3000 products.
    Is there kind of batch system to handle this kind of requests

    #181250
    Taha
    Moderator
    Plugin Support

    Hi Ned,

    Yes, the plugin can handle large feeds, even with 10,000 products. You can filter by stock status, product status, category, and more.

    It supports batching using Offset products and Total products, so feeds can be generated in smaller parts—for example, 0–3,000 products in the first file, 3,001–6,000 in the next, etc.

    Batches can be run manually via the AJAX option or automated with a cron job, ensuring even very large feeds are created efficiently without timeouts.

    Best regards

    #182655
    Ned
    Participant

    Lastly, it is possible to filter for custom metafield for products?
    I have custom field like this
    <p class=”p1″><span class=”s1″>function</span><span class=”s2″> generatepress_child_admin_xml_status_field() {</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>    </span></span><span class=”s1″>global</span><span class=”s2″> $post;</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>    </span></span><span class=”s1″>if</span><span class=”s2″> ( ! $post || ! isset( $post->ID ) ) {</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>        </span></span><span class=”s1″>return</span><span class=”s2″>;</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>    </span>}</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>    </span>$value <span class=”Apple-converted-space”>  </span>= get_post_meta( $post->ID, </span><span class=”s3″>’xml_status'</span><span class=”s2″>, </span><span class=”s1″>true</span><span class=”s2″> );</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>    </span>$checked = ( $value === </span><span class=”s3″>’exclude'</span><span class=”s2″> ) ? </span><span class=”s3″>’yes'</span><span class=”s2″> : </span><span class=”s3″>’no'</span><span class=”s2″>;</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>    </span>woocommerce_wp_checkbox(</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>        </span>array(</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>            </span></span><span class=”s3″>’id'</span><span class=”s2″><span class=”Apple-converted-space”>          </span>=> </span><span class=”s3″>’xml_status'</span><span class=”s2″>,</span></p>
    <p class=”p3″><span class=”s5″><span class=”Apple-converted-space”>            </span></span><span class=”s2″>’label'</span><span class=”s5″> <span class=”Apple-converted-space”>      </span>=> __( </span><span class=”s2″>’XML status'</span><span class=”s5″>, </span><span class=”s2″>’generatepress_child'</span><span class=”s5″> ),</span></p>
    <p class=”p3″><span class=”s5″><span class=”Apple-converted-space”>            </span></span><span class=”s2″>’description'</span><span class=”s5″> => __( </span><span class=”s2″>’this products will be (exclude)'</span><span class=”s5″>, </span><span class=”s2″>’generatepress_child'</span><span class=”s5″> ),</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>            </span></span><span class=”s3″>’value'</span><span class=”s2″> <span class=”Apple-converted-space”>      </span>=> $checked,</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>        </span>)</span></p>
    <p class=”p1″><span class=”s2″><span class=”Apple-converted-space”>    </span>);</span></p>
    <p class=”p4″><span class=”s4″>}</span></p>

    #182656
    Ned
    Participant

    function generatepress_child_admin_xml_status_field() {
    global $post;
    if ( ! $post || ! isset( $post->ID ) ) {
    return;
    }
    $value = get_post_meta( $post->ID, ‘xml_status’, true );
    $checked = ( $value === ‘exclude’ ) ? ‘yes’ : ‘no’;

    woocommerce_wp_checkbox(
    array(
    ‘id’ => ‘xml_status’,
    ‘label’ => __( ‘XML status’, ‘generatepress_child’ ),
    ‘description’ => __( ‘İşaretlenmiş ürünler XML\’den çıkarılır (exclude)’, ‘generatepress_child’ ),
    ‘value’ => $checked,
    )
    );
    }

    #182711
    birendra
    Moderator

    Hi Ned,

    Yes, the XML feed can filter products by a custom meta field, but the meta key must be saved for the product.

    From your snippet, it looks like a function definition. To filter, you need the actual meta key (e.g., xml_status ) and its value saved. Once saved, you can use the Custom Meta Filter in the XML feed settings:

    • Meta Key: xml_status
    • Condition: =
    • Value: yes

    I’ve attached the screenshot for reference:
    https://prnt.sc/jvAYqms1YPiM

    Please give it a try and let us know how it works.

    Best regards

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.