Jump to content

Possibility for default in stock/out of stock message and media?


Recommended Posts

Is it possible to set a default text that would be when I create a product.. I am soo tired of writing each of these texts in 4 different languages when they are supposed to be exactly the same on all products.

So are there any hidden buttons I have not seen yet? or maybe some place in php, tpl, sql I could do some editing after or before?

Displayed text when in-stock:

Displayed text when allowed to be back-ordered:

When out of stock:


Same is when adding pictures or video on a product. why can`t they just copy themselves like the text for a product when I create them?.. Could I also there edit something in a php,tpl,sql to make this happen?

Link to comment
Share on other sites

You could edit admin/tabs/AdminProducts.php and set up a default value in the text field. It is the following code on lines 1798-1819 that you would need to change:


'.$this->l('Displayed text when in-stock:').'
';
foreach ($this->_languages as $language)
   echo '        
                       <input size="30" type="text" id="available_now_'.$language['id_lang'].'" name="available_now_'.$language['id_lang'].'"
                       value="'.stripslashes(htmlentities($this->getFieldValue($obj, 'available_now', $language['id_lang']), ENT_COMPAT, 'UTF-8')).'" />
'.$this->l('Forbidden characters:').' <>;=#{} 
';
echo '            


'.$this->l('Displayed text when allowed to be back-ordered:').'
';
foreach ($this->_languages as $language)
   echo '        
                       <input size="30" type="text" id="available_later_'.$language['id_lang'].'" name="available_later_'.$language['id_lang'].'"
                       value="'.stripslashes(htmlentities($this->getFieldValue($obj, 'available_later', $language['id_lang']), ENT_COMPAT, 'UTF-8')).'" />
'.$this->l('Forbidden characters:').' <>;=#{} 
';
echo '            



to something like:


'.$this->l('Displayed text when in-stock:').'
';
foreach ($this->_languages as $language)
   echo '        
                       <input size="30" type="text" id="available_now_'.$language['id_lang'].'" name="available_now_'.$language['id_lang'].'"
                       value="'.(stripslashes(htmlentities($this->getFieldValue($obj, 'available_now', $language['id_lang']), ENT_COMPAT, 'UTF-8')) == '' ? 'Default in-stock text' :stripslashes(htmlentities($this->getFieldValue($obj, 'available_now', $language['id_lang']), ENT_COMPAT, 'UTF-8'))) .'" />
'.$this->l('Forbidden characters:').' <>;=#{} 
';
echo '            


'.$this->l('Displayed text when allowed to be back-ordered:').'
';
foreach ($this->_languages as $language)
   echo '        
                       <input size="30" type="text" id="available_later_'.$language['id_lang'].'" name="available_later_'.$language['id_lang'].'"
                       value="'.(stripslashes(htmlentities($this->getFieldValue($obj, 'available_later', $language['id_lang']), ENT_COMPAT, 'UTF-8')) == '' ? 'Default back-ordered text' : stripslashes(htmlentities($this->getFieldValue($obj, 'available_later', $language['id_lang']), ENT_COMPAT, 'UTF-8'))).'" />
'.$this->l('Forbidden characters:').' <>;=#{} 
';
echo '            



Change 'Default in-stock text' and 'Default back-ordered text' to the default text you want in those fields.

  • Like 1
Link to comment
Share on other sites

hmm.. Would it be possible to make it pull the text from external files that are named instock_en / outofstock_en.php or .xml ??

That way I could have one for each language and get a default text.

Is it also possible to have it pull with it all text/media to all languages that is from Short description: and Description: when making a new product?.. just like it does for Name: Supplier Reference: and other.

This would make it easy to make the products first, and then start translate each product after. This is because I get external people translate after I mad the product.
what I need to do today is to copy/paste for each description field when making a new product.

Link to comment
Share on other sites

  • 9 months later...
  • 6 months later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...