Posts

Showing posts from June, 2016

How do I reset the value of a text input when the page reloads?

You can use plain old HTML :) Set autocomplete='off' in the attribute type = 'text' value = 'default text' autocomplete = 'off' /> This works on most modern browsers.

how to set textbox value to empty(blank) using javascript

assuming the element you want to change has the id 'question' you can do document . getElementById ( "question" ). value = "" ;   another example if  var doc_val_check = $ ( '#doc_title' ). attr ( "value" ); if ( doc_val_check . length > 0 ) { doc_val_check == "" ; }   doc_val_check == "" ; // == is equality check operator should be doc_val_check = "" ; // = is assign operator. you need to set empty value // so you need = You can write you full code like this: var doc_val_check = $ . trim ( $ ( '#doc_title' ). val () ); // take value of text // field using .val() if ( doc_val_check . length ) { doc_val_check = "" ; // this will not update your text field } To update you text field with a "" you need to try $ ( '

PHP Echo text Color

echo '

Change opencart logo in order email

  Just change the logo in //catalog/model/checkout/order.php:441 $data['logo'] = $this->config->get('config_url') . 'image/' . $this->config->get('config_logo'); or in catalog/view/theme/default/template/mail/order.tpl:8 change the image source

Opencart Product Option Images set automatically to 50x50

Great! But my image is REALLY SMALL! What's going on?? By default, OpenCart passes you an image that is 50x50. If you would like it in a different size (say 228x228, the typical size of the product image) you will need to make these changes below. Catalog/Controller/Product/Product.php Find this bit of code Code:  foreach ($option['option_value'] as $option_value) {                   if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {                      $option_value_data[] = array(                         'product_option_value_id' => $option_value['product_option_value_id'],                         'option_value_id'         => $option_value['option_value_id'],                         'name'                    => $option_value['name'],                         'image'                   => $this->model_tool_image->resize($option_value['image'], 50, 50