Jump to content

Need help for creating more similar "Online only" options.


Recommended Posts

I need to display "Online only" "Advanced booking" "Limited time only" "Exclusive collection" message on Product Page for different products. So I have edited three files.

 

1. /adminxxx//themes/default/template/controllers/products/informations.php

<div class="checkbox">
	<label for="online_only">
		<input type="checkbox" name="online_only" id="online_only" value="1" {if $product->online_only}checked="checked"{/if} >
		{l s='Online only (not sold in your retail store)'}</label>
</div>		

<div class="checkbox">
	<label for="advanced_only">
		<input type="checkbox" name="advanced_only" id="advanced_only" value="1" {if $product->advanced_only}checked="checked"{/if} >
		{l s='Advanced only (not sold without advanced payment)'}</label>
</div>

<div class="checkbox">
	<label for="limited_time_only">
		<input type="checkbox" name="limited_time_only" id="limited_time_only" value="1" {if $product->limited_time_only}checked="checked"{/if} >
		{l s='Limited time only (ofer valid for limited time only)'}</label>
</div>

<div class="checkbox">
	<label for="exclusive_collection">
		<input type="checkbox" name="exclusive_collection" id="exclusive_collection" value="1" {if $product->exclusive_collection}checked="checked"{/if} >
		{l s='Exclusive Collection (our exclusive collection product)'}</label>
</div>

2. /classes/Product.php

/** @var bool online_only */
    public $online_only = false;
	
/** @var bool advanced_only */
    public $advanced_only = false;
	
/** @var bool limited_time_only */
    public $limited_time_only = false;
	
/** @var bool exclusive_collection */
    public $exclusive_collection = false;
 
'online_only' =>                array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'advanced_only' =>                array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'limited_time_only' =>                array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'exclusive_collection' =>                array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
             

3. /themes/my-theme/product.tlp

{if $product->online_only}
	<p class="online_only">{l s='Online only'}</p>
{/if}

{if $product->advanced_only}
	<p class="online_only">{l s='Advanced only'}</p>
{/if}

{if $product->limited_time_only}
	<p class="online_only">{l s='Limited time only'}</p>
{/if}

{if $product->exclusive_collection}
	<p class="online_only">{l s='Exclusive collection'}</p>
{/if} 

Now I can see these options on Catalog>Products>Information. But now I can not save my products (existing or new). When I try to save I face "An error occurred while updating an object. product ()" message. I am using PS 1.6.1.9 version. NB: I also face same problem for version 1.6.1.8

 

Thanks in advanced and sorry for my bad English  :)

Edited by Ziaur Rahman (see edit history)
Link to comment
Share on other sites

How help? I give exactly what you need, all you had to do is change tabel and column name and run this statement in your database. Check in database how looks on_sale column and you will be know everything.

 

Before you do anything in database make shure you have safty copy.

Link to comment
Share on other sites

How help? I give exactly what you need, all you had to do is change tabel and column name and run this statement in your database. Check in database how looks on_sale column and you will be know everything.

 

Before you do anything in database make shure you have safty copy.

Thanks for your response. I have created 3 new columns in psxx_product and psxx_product_shop table. Now my problem is solved.

Link to comment
Share on other sites

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...