| Author |
Message |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Thu May 07, 2009 7:13 am |
|
First off I would like to congratulate you on an excellent shop, the installation was a breeze and it is extremely easy to use.
OK so now for the question.
Is it possible to alter the number of columns displayed. At the moment it shows the items on the homepage and within the categories in 2 columns, I would like if possible to alter this to 5 columns.
...and if I could slip another one in, is it possible to alter the title "Digital Shop" to something else?
Thanks in advance
Jakec  |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 921
|
Posted:
Thu May 07, 2009 8:46 am |
|
Hi, welcome to the site and thanks for purchasing the shop.
To change the number of columns displayed this post should explain how...
The file to edit is modules/Digital_Shop/templates/XXX/shop/main.tpl
http://nukecoder.com/ftopicp-3207-Theme_Tweaks.html#3207
You will just need to tweak the number a bit to suit your needs.(don't forget to change the width% on the td's)
To change the title, I would suggest using dynamic titles. Here is the snippet of code to add to includes/dynamic_titles.php
| Code: |
// shop
if ($name == "Digital_Shop")
{
$spr = '-';
if ($_GET['act'] == 'showItem' && $_GET['item'])
{
$item = intval($_GET['item']);
$sql = "SELECT i.item_name, c.title FROM shop_items i, shop_categories c WHERE i.item_id='$item' AND c.id=i.item_cat";
$result = $db->sql_query($sql);
list($item_title, $cat_title) = $db->sql_fetchrow($result);
$newpagetitle= "Viewing Item: $item_title $spr Category: $cat_title $spr $sitename";
$newpagetitle = check_html($newpagetitle, 'nohtml');
}
elseif ($_GET['cat'])
{
$cat = intval($_GET['cat']);
$sql = "SELECT title FROM shop_categories WHERE id='$cat'";
$result = $db->sql_query($sql);
list($cat_title) = $db->sql_fetchrow($result);
$newpagetitle= "Digital Goods Shop Category: $cat_title $spr $sitename";
$newpagetitle = check_html($newpagetitle, nohtml);
}
elseif ($_GET['act'] == 'categories')
{
$newpagetitle= "Digital Goods Shop Category List $spr $sitename";
}
} |
Note, the dynamic titles code needs updated, but it will still work fine. |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Thu May 07, 2009 11:30 am |
|
How did I miss that post! I did a search, but didn't find it, I should know better.
Thanks for the quick reply I'll have a look and let you know how I get on. |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 921
|
Posted:
Thu May 07, 2009 12:14 pm |
|
I searched too and couldn't find it, but I remembered posting it. It took me a few tries to find that one lol. |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Fri May 08, 2009 2:26 am |
|
I'm glad it is not just me then.  |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Sun May 10, 2009 1:53 pm |
|
That seemed to do the trick, although to help it fit better with my theme (Ravenice) I added an extra row in so the Download button is below the Extra Images text.
The code looks like this:
| Code: |
<tr>
<td>
{if $item.item_cost == "0.00"}
<input>
{else}
{if $single_item_mode == 1}
<a><img></a>
{else}
<form>
<input>
<input>
<input>
<input>
</form>
{/if}
{/if}
</td>
</tr> |
This works but the first column is too wide.  |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Sun May 10, 2009 2:16 pm |
|
OK just realised that I got that wrong.
Should of closed the previous row before starting the next row, which I've done now but still having the same problem.  |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Sun May 10, 2009 3:52 pm |
|
OK it was my fault I missed changing a 50% to 25%. Doh! |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Sun May 24, 2009 10:29 am |
|
I'm still trying to get my head around the Smarty templates and tried to apply the same logic to the category list on the main page. I got close, but couldn't get it to work.
How would I change the display to four columns?
Thanks in advance
jakec |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 921
|
Posted:
Mon May 25, 2009 9:10 am |
|
Ok, this one is a little different I guess
So first thing is to open up templates/xxx/shop/main.tpl and find
| Code: |
{if $cat_array != ''}
{include file="$current_theme/blocks/block1-open.tpl"} |
That is where the category display starts. Directly under that, the table width needs changed from 80% to 100%
Then there are 3 td's that need the width changed from 50% to 25%
So now that that is done, we move to the fun stuff... Find
| Code: |
{if $smarty.foreach.catlist.iteration is even} |
And change to
| Code: |
{if $smarty.foreach.catlist.iteration is not div by 4} |
Next find....
| Code: |
{elseif $smarty.foreach.catlist.iteration is odd && $smarty.foreach.catlist.iteration != 1} |
And Change to...
| Code: |
{elseif $smarty.foreach.catlist.iteration is div by 4 && $smarty.foreach.catlist.iteration != 4} |
And finally, delete the following code...
| Code: |
{if $smarty.foreach.catlist.iteration is odd}
</td><td>
{/if}
|
Save & Upload
Note: This code is untested so please let me know how it goes. |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Tue May 26, 2009 7:18 am |
|
Thanks Gotcha I will give this a go tonight when I get home.  |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Tue May 26, 2009 3:47 pm |
|
Something is not quite right with this at the moment. This is what the section of code currently looks like:
| Code: |
{if $cat_array != ''}
{include file="$current_theme/blocks/block1-open.tpl"}
<table>
<tr>
<td>
{foreach from=$cat_array item=cat name=catlist}
{if $smarty.foreach.catlist.iteration is not div by 4}
</td>
<td>
{elseif $smarty.foreach.catlist.iteration is div by 4 && $smarty.foreach.catlist.iteration != 4}
</td>
</tr>
<tr>
<td>
{/if}
<a>{if $cat.image != ''}<img><br>{/if}{$cat.title}</a> ({$cat.item_count})
{if $cat.details != ''}<br> {$cat.details} {/if}<br>
{/foreach}
</td>
</tr>
</table>
{include file="$current_theme/blocks/block1-close.tpl"}
<br>
{/if} |
|
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Wed Jun 03, 2009 7:24 am |
|
I hope everything is OK Gotcha, it's gone a bit quiet.  |
| |
|
|
 |
gotcha
Site Admin


Joined: Oct 25, 2004
Posts: 921
|
Posted:
Wed Jun 03, 2009 3:15 pm |
|
Yeah, I know, I wanted to be able to sit down and come up with something that will for sure work and be able to test it to make sure it does. Here is what I came up with. |
| |
|
|
 |
jakec

Joined: May 02, 2009
Posts: 21
|
Posted:
Wed Jun 03, 2009 4:27 pm |
|
Once again thanks, it is greatly appreciated.
I'll give it a go now and let you know how it goes. |
| |
|
|
 |
|
|