Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2015
    Posts
    423
    Plugin Contributions
    0

    Default add "products_quantity_order_min" to strcutre data markup

    Zencart 5.7
    php 7.4

    I am currently using zencart super data markup
    https://www.zen-cart.com/downloads.php?do=file&id=1984

    I need to add the field "products_quantity_order_min" into the structure data.


    In the super_data_head.php the code is below.

    I tried adddng this <?php Print $products_quantity_order_min; ?> but nothing ever populates.

    Can someone assist me or lead me in the right direction on getting the min-order-quantity on the structure data



    Code:
    <script type="application/ld+json">
    
    
    {
    
      "@context": "http://schema.org",
    
       "@type": "Product",
    
       "@id": "<?php echo htmlspecialchars_decode($canonicalLink, ENT_NOQUOTES); ?>",
    
        "brand": "<?php echo $manufacturers_name; ?>",
    
        "mpn": "<?php echo htmlspecialchars($products_model); ?>",
    
        "sku": "<?php echo $products_id; ?>",
    
        "url": "<?php echo htmlspecialchars_decode($canonicalLink, ENT_NOQUOTES); ?>",
    
        "name": "<?php echo htmlspecialchars($products_name); ?>",
    
        "description": "<?php echo META_TAG_DESCRIPTION; ?>",
    
        "image": "<?php echo $fb_image; ?>",
    
    
       "offers": {
    
        "@type" : "Offer",
    
        "availability" : "<?php if ($products_quantity > 0) { ?>http://schema.org/InStock<?php } ?><?php if ($products_quantity == 0) { ?>http://schema.org/OutOfStock<?php }?>",
    
        "price" : "<?php echo $specials_new_products_price = (round(zen_get_products_actual_price($product_info_metatags->fields['products_id']),2)); ?>",
    
        "priceCurrency" : "<?php if (FACEBOOK_OPEN_GRAPH_CUR != '') { ?><?php echo FACEBOOK_OPEN_GRAPH_CUR; ?><?php } ?>",
    
        "seller" : "<?php echo STORE_NAME; ?>",
    
        "itemCondition" : "http://schema.org/<?php if (FACEBOOK_OPEN_GRAPH_COND != '') { ?><?php echo FACEBOOK_OPEN_GRAPH_COND; ?><?php }?>",
    
        "inventoryLevel" : "<?php echo $products_quantity; ?>",    
    
        "deliveryLeadTime" : "<?php if (FACEBOOK_OPEN_GRAPH_DTS != '') { ?><?php echo FACEBOOK_OPEN_GRAPH_DTS; ?><?php }?>",
    
        "category" : "<?php echo htmlspecialchars($categories->fields['categories_name']); ?>",
    
        "itemOffered" : "<?php echo htmlspecialchars($products_name); ?>",
    
        "url": "<?php echo htmlspecialchars_decode($canonicalLink, ENT_NOQUOTES); ?>",
    
        "priceValidUntil": "<?php echo date('Y-m-d', strtotime("+30 days")); ?>",
         
        "eligibleRegion" : "<?php if (FACEBOOK_OPEN_GRAPH_ELER != '') { ?><?php echo FACEBOOK_OPEN_GRAPH_ELER; ?><?php }?>",
    
        "acceptedPaymentMethod" : [ "http://purl.org/goodrelations/v1#<?php echo FACEBOOK_OPEN_GRAPH_PAY1; ?>,http://purl.org/goodrelations/v1#<?php echo FACEBOOK_OPEN_GRAPH_PAY2; ?>,http://purl.org/goodrelations/v1#<?php echo FACEBOOK_OPEN_GRAPH_PAY3; ?>,http://purl.org/goodrelations/v1#<?php echo FACEBOOK_OPEN_GRAPH_PAY4; ?>,http://purl.org/goodrelations/v1#<?php echo FACEBOOK_OPEN_GRAPH_PAY5; ?>,http://purl.org/goodrelations/v1#<?php echo FACEBOOK_OPEN_GRAPH_PAY6; ?>" ]    
    
    
    } 
    
    }
    
    </script>

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: add "products_quantity_order_min" to strcutre data markup

    As far as I can tell there's no such field for minimum product quantity in the official structured-data Product schema, so I'm not sure what your real goal is, nor "where" you believe it belongs in the generated structured-data output.

    But ... to retrieve the value from Zen Cart:
    Around line 114 is a list of fields being retrieved from the database. Add yours on a new line there. Be sure to include the comma which separates it from other fields.
    Then you can refer to it like: $product_info->fields['your_field_name_here']

    and then echo it into whatever part of the structured data json output you believe it belongs in.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v139h Cannot "add to cart", "sign up", or "log in". Returns to home.
    By Damn Kitten in forum General Questions
    Replies: 3
    Last Post: 12 Aug 2013, 03:11 AM
  2. Replies: 2
    Last Post: 11 Feb 2010, 09:13 PM
  3. Remove "Add: [ ]" and "Add selected products to cart" from product pages? possible?
    By edwardtilbury in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 Sep 2008, 03:13 AM
  4. Modify "add to cart" "write a review" "tell a friend"
    By Marlake in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 10 May 2008, 12:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR