Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"availability": "http://schema.org/OutOfStock", Mass change?


Guest

Recommended Posts

2.3.4 bs gold

I was just looking at my source code and noticed: "availability": "http://schema.org/OutOfStock",

These are items that are marked In Stock but I don't enter quantities. If I need to change all quantities from 0 to 100, is there a quick way?

Thanks

Link to comment
Share on other sites

As people buy your products, this number will change.

If you want to always have products as "preorder" or "instock" (in other words, never show "outofstock"), in product_info.php

FIND:

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
      $products_price .= '<link itemprop="availability" href="http://schema.org/PreOrder" />';
    } elseif ((STOCK_CHECK == 'true') && ($product_info['products_quantity'] < 1)) {
      $products_price .= '<link itemprop="availability" href="http://schema.org/OutOfStock" />';
    } else {
      $products_price .= '<link itemprop="availability" href="http://schema.org/InStock" />';
    }

Change to:

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
      $products_price .= '<link itemprop="availability" href="http://schema.org/PreOrder" />';
    } else {
      $products_price .= '<link itemprop="availability" href="http://schema.org/InStock" />';
    }

 

This particular area of coding needs to be changed from this "inline" style of code and put into some sort of a module.  At some point, maybe.

Link to comment
Share on other sites

There's also a setting under admin/configuration/stock called "subtrack stock" that can be set to false.  Like in my case where most items are bought in bulk and sold in different quantities, it's better to not subtract.

I'm not really a dog.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...