Hi
I want to create more module positions for my layout and cant seem to find where to register these
I realy need more than left and right!
<div id="toprightbasket">
<?php foreach ($modules as $module) { ?>
<?php if ($module['position'] == 'topright, footer, main etc, etc, etc,') { ?>
<?php echo ${$module['code']}; ?>
<?php } ?>
<?php } ?>
</div>
Is there a tutorial or advice on this already, i couldnt find any.
thanks
I want to create more module positions for my layout and cant seem to find where to register these
I realy need more than left and right!
<div id="toprightbasket">
<?php foreach ($modules as $module) { ?>
<?php if ($module['position'] == 'topright, footer, main etc, etc, etc,') { ?>
<?php echo ${$module['code']}; ?>
<?php } ?>
<?php } ?>
</div>
Is there a tutorial or advice on this already, i couldnt find any.
thanks
MVCL stupid!
add the following.
admin\controller\module\cart.php
$this->data['text_top'] = $this->language->get('text_top');
dmin\language\english\modulecart.php
$_['text_top'] = 'top';
admin\view\template\module\cart.tpl
<?php if ($cart_position == 'top') { ?>
<option value="top" selected="selected"><?php echo $text_top; ?></option>
<?php } else { ?>
<option value="top"><?php echo $text_top; ?></option>
<?php } ?>
add to the template
catalog\view\theme\default\template\common\layout.tpl
<div id="topleftmenu">
<?php foreach ($modules as $module) { ?>
<?php if ($module['position'] == 'top') { ?>
<?php echo ${$module['code']}; ?>
<?php } ?>
<?php } ?>
</div>
i think that was all o changed ...
add the following.
admin\controller\module\cart.php
$this->data['text_top'] = $this->language->get('text_top');
dmin\language\english\modulecart.php
$_['text_top'] = 'top';
admin\view\template\module\cart.tpl
<?php if ($cart_position == 'top') { ?>
<option value="top" selected="selected"><?php echo $text_top; ?></option>
<?php } else { ?>
<option value="top"><?php echo $text_top; ?></option>
<?php } ?>
add to the template
catalog\view\theme\default\template\common\layout.tpl
<div id="topleftmenu">
<?php foreach ($modules as $module) { ?>
<?php if ($module['position'] == 'top') { ?>
<?php echo ${$module['code']}; ?>
<?php } ?>
<?php } ?>
</div>
i think that was all o changed ...
Good stuff.
Yeah, basically copy the code for the left/right modules...
Yeah, basically copy the code for the left/right modules...
http://www.alreadymade.com
Follow me on twitter.com/alreadymade
I must be doing something wrong.
I have ver 1.4.9.3. and I dont have this file :
catalog\view\theme\default\template\common\layout.tpl
I tried creating it and added the content but it doesn't show up in the options.
Nothing seems to happen.
I still only have left and right.
I have ver 1.4.9.3. and I dont have this file :
catalog\view\theme\default\template\common\layout.tpl
I tried creating it and added the content but it doesn't show up in the options.
Nothing seems to happen.
I still only have left and right.
Personally, the code is somewhat correct but i think you should be creating new files for the module position, not adding them to the cart files.
catalog/view/theme/default/template/common/home.tpl
<?php echo $header; ?><?php echo $column_left; ?><?php echo $topleft; ?><?php echo $column_right; ?>
catalog/view/theme/default/template/common/topleft.tpl
See what i mean?
catalog/view/theme/default/template/common/home.tpl
<?php echo $header; ?><?php echo $column_left; ?><?php echo $topleft; ?><?php echo $column_right; ?>
catalog/view/theme/default/template/common/topleft.tpl
Code: Select all
<div id="topleft">
<?php foreach ($modules as $module) { ?>
<?php echo ${$module['code']}; ?>
<?php } ?>
</div>
Ok. How would you do it now then?
Will the new 1.5 have the option of more positions?
I love Opencart. Think it is the best thing since toasted bread. But it would be nice to have more options in placing modules. The client I have now wants dropdown menus!!
I have a template that puts the catagories in the dropdown menu position but what it we want to put other pages in the dropdown, like this template : http://themes.opencarttemplate.net/inde ... e=default6
Will the new 1.5 have the option of more positions?
I love Opencart. Think it is the best thing since toasted bread. But it would be nice to have more options in placing modules. The client I have now wants dropdown menus!!
I have a template that puts the catagories in the dropdown menu position but what it we want to put other pages in the dropdown, like this template : http://themes.opencarttemplate.net/inde ... e=default6
there is another thread regarding drop down header menu's.
Just copy all the code to do with column_left and create seperate files for each, relabeling everthing to for example topleft.
Then place <?php echo $topleft; ?> wherever you want the module position to be in each of the pages. i.e home, product, category etc.
Just copy all the code to do with column_left and create seperate files for each, relabeling everthing to for example topleft.
Then place <?php echo $topleft; ?> wherever you want the module position to be in each of the pages. i.e home, product, category etc.
Sure, i can do better than that, i can give you the direct link to the page that explains how
http://craigmurray.me.uk/opencart-mods/ ... -opencart/
and this may help also
http://www.alistapart.com/articles/dropdowns
http://craigmurray.me.uk/opencart-mods/ ... -opencart/
and this may help also
http://www.alistapart.com/articles/dropdowns
Thx. I will try it on a test site.
Can you look at something else please.
I made a post for this, but don't get any replies.
On this website : http://www.oscarmusic.co.za/index.php?r ... duct_id=54
The individual mp3's at the bottom can be added to the cart. Ho do I get it to just add to cart without moving to the cart page, like the "Add to Cart" button at the top?
Can you look at something else please.
I made a post for this, but don't get any replies.
On this website : http://www.oscarmusic.co.za/index.php?r ... duct_id=54
The individual mp3's at the bottom can be added to the cart. Ho do I get it to just add to cart without moving to the cart page, like the "Add to Cart" button at the top?
im guessing you need to add the AJAX add to cart function for those buttons, it should add them without moving to the cart page.
If you disable ajax add to cart in the module extension you will see it has the same affect.
Taken from the product.tpl file, notice the id="add_to_cart" and the function $('#product').submit();
If you disable ajax add to cart in the module extension you will see it has the same affect.
Code: Select all
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a>
Ok, if this is the code for the button, where would I add the function? I am still learning - thx for the advise!
<td>
<img alt="" src="http://www.oscarmusic.co.za/image/data/buy.jpg" style="width: 33px; height: 17px;" /></td>
I looked at the source of the page and it gives this for the "Add to Cart" button on top.
<form action="http://www.oscarmusic.co.za/index.php?r ... ckout/cart" method="post" enctype="multipart/form-data" id="product">
<div class="content">
Qty: <input type="text" name="quantity" size="3" value="1" />
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span>Add to Cart</span></a>
</div>
<div>
<input type="hidden" name="product_id" value="54" />
<input type="hidden" name="redirect" value="http://www.oscarmusic.co.za/index.php?r ... duct_id=54" />
</div>
</form>
I tried adding this to the button at the bottom and changing the product_is to the song instead of the album.
It then shows the "add to cart" button but when you click on it, it still adds the album and not the single mp3. And it takes you to the cart page. Must be doing something wrong
. I think it gets the product_id from the page in which it is displayed - thus the album_id - hopes this makes sense.
<td>
<img alt="" src="http://www.oscarmusic.co.za/image/data/buy.jpg" style="width: 33px; height: 17px;" /></td>
I looked at the source of the page and it gives this for the "Add to Cart" button on top.
<form action="http://www.oscarmusic.co.za/index.php?r ... ckout/cart" method="post" enctype="multipart/form-data" id="product">
<div class="content">
Qty: <input type="text" name="quantity" size="3" value="1" />
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span>Add to Cart</span></a>
</div>
<div>
<input type="hidden" name="product_id" value="54" />
<input type="hidden" name="redirect" value="http://www.oscarmusic.co.za/index.php?r ... duct_id=54" />
</div>
</form>
I tried adding this to the button at the bottom and changing the product_is to the song instead of the album.
It then shows the "add to cart" button but when you click on it, it still adds the album and not the single mp3. And it takes you to the cart page. Must be doing something wrong

This is the code:
<td>
<a href="http://www.oscarmusic.co.za/index.php?r ... d=55"><img alt="" src="http://www.oscarmusic.co.za/image/data/buy.jpg" style="width: 33px; height: 17px;" /></a></td>
Basically I added the single track as a product so that it has its own product_id.
<td>
<a href="http://www.oscarmusic.co.za/index.php?r ... d=55"><img alt="" src="http://www.oscarmusic.co.za/image/data/buy.jpg" style="width: 33px; height: 17px;" /></a></td>
Basically I added the single track as a product so that it has its own product_id.
the problem is, if you use a form and onclick to submit the single track products to the cart it wont work, because it will send the data based on the original form which is the main product add to cart button.
Plus the way in which the ajax function is set up, it only allows one product_id to be sent to the cart, i.e the product page's product_id.
Seems to me you need a new ajax function which includes the product_id value based on the button that was clicked.
Plus the way in which the ajax function is set up, it only allows one product_id to be sent to the cart, i.e the product page's product_id.
Seems to me you need a new ajax function which includes the product_id value based on the button that was clicked.
You can add extra positions simply using this extansion
http://www.opencart.com/index.php?route ... on_id=6916
http://www.opencart.com/index.php?route ... on_id=6916
Many OpenCart users struggle to find quality extensions. We know how frustrating the need to fix the shop is just because of one poorly coded extension. We created quality OpenCart Extensions, tested by real developers and provide professional support.
AJAX QUICK CHECKOUT - #1 one-page checkout solution
VISUAL DESIGNER - Page builder for Opencart
View more extensions here
Tested by Shopunity.net
Who is online
Users browsing this forum: No registered users and 2 guests