Recently I gave the slideshow/manufactures/carousel 'banners' to have an option of which store they will appear on. This would mean you no longer need to create a new layout for each site if all you want to do is change the pictures in the banners.
-----------------
You just want a module called 'Multi-Store Price Change'?
User Interface Options:
Store: <A><B>
Price Increase (%): [text box]
*Disclaimer: I hope I have been as clear as possible and helpful. If you are unsure of anything please ask I will be happy to help - I do frequently watch the posts I have posted in previously.
How to change prices across a whole multi-store, with a baseline price for each product:
http://forum.opencart.com/viewtopic.php ... 24#p406793
This will allow you to create as stated above:
Default domain: base price.
- Domain1: Change % of prices across the whole store. (e.g. +5%)
- Domain2: Change % of prices across the whole store. (e.g. -30%)
<<< Please let me know what you think. >>>
Step 1. - Lets add in the label that will display in the Store 'Settings' first.
File: admin->language->english->settings->store.php
After: (Lets keep things tidy)
Code: Select all
$_['entry_layout'] = 'Default Layout:';
Code: Select all
$_['entry_site_product_increase'] = 'Please enter how much you want to increase products by on this store (e.g. 1.5 is +50%, 1.05 is +5%, 0.5 is -50%). The default value should be 1.';
File: admin->view->template->setting->store_form.tpl
After: (Around line 1.04)
Code: Select all
<tr>
<td><?php echo $entry_layout; ?></td>
<td><select name="config_layout_id">
<?php foreach ($layouts as $layout) { ?>
<?php if ($layout['layout_id'] == $config_layout_id) { ?>
<option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
<?php } ?>
<?php } ?>
</select></td>
</tr>
Code: Select all
<tr>
<td><span class="required">*</span> <?php echo $entry_site_product_increase; ?></td>
<td><input type="text" name="config_site_product_increase" value="<?php echo $config_site_product_increase; ?>" />
</tr>
Step 3. - Need to add these variables to the controller
File: admin->controller->setting->store.php
After: (Around line 207)
Code: Select all
$this->data['entry_layout'] = $this->language->get('entry_layout');
Code: Select all
$this->data['entry_site_product_increase'] = $this->language->get('entry_site_product_increase');
File: same file.
After: (Around line 485)
Code: Select all
if (isset($this->request->post['config_layout_id'])) {
$this->data['config_layout_id'] = $this->request->post['config_layout_id'];
} elseif (isset($store_info['config_layout_id'])) {
$this->data['config_layout_id'] = $store_info['config_layout_id'];
} else {
$this->data['config_layout_id'] = '';
}
Code: Select all
if (isset($this->request->post['config_site_product_increase'])) {
$this->data['config_title'] = $this->request->post['config_site_product_increase'];
} elseif (isset($store_info['config_site_product_increase'])) {
$this->data['config_site_product_increase'] = $store_info['config_site_product_increase'];
} else {
$this->data['config_site_product_increase'] = '';
}
*If you save all you have done so far and go to your settings in another store (not the default one) you should now see the input box there. This value will now save and will be saved in the database. But the prices of products will not change yet.
Step 4. - Now lets update the product price on the store
File: catalog->model->catalog->product.php
After: (Around line 14)
Code: Select all
$query = $this->db->query("SELECT DISTINCT...
Code: Select all
$store_price_change_query = $this->db->query("SELECT value FROM " . DB_PREFIX ."setting WHERE `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `key` LIKE 'config_site_product_increase'");
if ($store_price_change_query->num_rows) {
$price_change = $store_price_change_query->row['value'];
}
else {
$price_change = '1';
}
File: same file
Change: (Around line 47)
Code: Select all
'price' => ($query->row['discount'] ? $query->row['discount'] : $query->row['price']),
Code: Select all
'price' => ($query->row['discount'] ? $query->row['discount'] : $query->row['price']) * $price_change,
Step 5. - Changing Cart in Library
File: system->library->cart.php
After: (Around line 163)
Code: Select all
if ($this->customer->isLogged()) {
$customer_group_id = $this->customer->getCustomerGroupId();
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
Code: Select all
$store_price_change_query = $this->db->query("SELECT value FROM " . DB_PREFIX ."setting WHERE `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `key` LIKE 'config_site_product_increase'");
if ($store_price_change_query->num_rows) {
$price_change = $store_price_change_query->row['value'];
}
else {
$price_change = '1.5';
}
File: same as before
Change: (Just after the code you just added / Line 173)
Code: Select all
$price = $product_query->row['price'];
Code: Select all
$price = $product_query->row['price']*$price_change;
That should be it. Please let me know what you think of the above. This does not allow you to change the default store from the original prices however. Just other stores.
Suggestions:
- Not allow the % to go below -50%
- Check for valid input of a number
*Disclaimer: I hope I have been as clear as possible and helpful. If you are unsure of anything please ask I will be happy to help - I do frequently watch the posts I have posted in previously.
How to change prices across a whole multi-store, with a baseline price for each product:
http://forum.opencart.com/viewtopic.php ... 24#p406793
Users browsing this forum: No registered users and 16 guests