Skip to content

Commit

Permalink
Merge remote branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	framework/modules/ecommerce/views/store/showall.tpl
  • Loading branch information
illiphilli committed Jun 16, 2011
2 parents 1b9f169 + 94fbf3e commit 87ce25b
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 173 deletions.
2 changes: 1 addition & 1 deletion framework/datatypes/shippingcalculator.php
Expand Up @@ -32,7 +32,7 @@ public function __construct($params=null, $get_assoc=true, $get_attached=true) {
if (file_exists(BASE.'framework/modules/ecommerce/shippingcalculators/icons/'.$this->classname.'.gif')) {
$this->icon = PATH_RELATIVE.'framework/modules/ecommerce/shippingcalculators/icons/'.$this->classname.'.gif';
} else {
$this->icon = PATH_RELATIVE.'framework/modules/ecommerce/shippingcalculators/icons/default.gif';
$this->icon = PATH_RELATIVE.'framework/modules/ecommerce/shippingcalculators/icons/default.png';
}

}
Expand Down
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -60,18 +60,20 @@ public function getRates($order) {
//52 - PuertoRico
$stateUpcharge = array('2','21','52');

if(!empty($c)) {
$rates = array();
if(!empty($c)) {
for($i = 0; $i < count($c); $i++) {

if (in_array($currentMethod->state, $stateUpcharge)) {
$c[$i] += 1.50; $c[$i] += 1.50;
}
$rates[0 . ($i+1)] = array('id' => 0 . ($i+1), 'title' => $this->shippingspeeds[$i]->speed, 'cost' => $c[$i]);
if($i <= 9) $rates[($i+1)] = array('id' => 0 . ($i+1), 'title' => $this->shippingspeeds[$i]->speed, 'cost' => $c[$i]);
else $rates[0 . ($i+1)] = array('id' => 0 . ($i+1), 'title' => $this->shippingspeeds[$i]->speed, 'cost' => $c[$i]);

}
}

if(!count($rates)) $rates[01] = array('id' => 01, 'title' => "Table Based Shipping is Currently NOT Configured", 'cost' => 0);
return $rates;
}

Expand Down
339 changes: 170 additions & 169 deletions framework/modules/ecommerce/views/store/showall.tpl
@@ -1,169 +1,170 @@
{*
* Copyright (c) 2007-2008 OIC Group, Inc.
* Written and Designed by Adam Kessler
*
* This file is part of Exponent
*
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* GPL: http://www.gnu.org/licenses/gpl.txt
*
*}

{css unique="storeListing" link="`$asset_path`css/storeListing.css"}

{/css}



<div class="module store showall">

{if $moduletitle}<h1>{$moduletitle}</h1>{/if}
<h1>
<span>{$current_category->title}</span>
{if $current_category->expFile[0]->id}
{img file_id=$current_category->expFile[0]->id w=600 h=100 zc=1}
{/if}
</h1>
{if $current_category->id}
{permissions}
{if $permissions.edit == 1}
{icon action=edit module=storeCategory record=$current_category title="Edit `$current_category->title`" text="Edit this Store Category"}{br}
{/if}
{*if $permissions.manage == 1}
{icon action=configure module=storeCategory record=$current_category title="Configure `$current_category->title`" text="Configure this Store Category"}{br}
{/if*}
{*if $permissions.manage == 1}
{icon action=configure module=ecomconfig hash="#tab2" title="Configure Categories Globally" text="Configure Categories Globally"}{br}
{/if*}
{if $permissions.manage == 1 && $config.orderby=="rank"}
{ddrerank label="Products" sql=$rerankSQL model="product" controller="storeCategory" id=$current_category->id}
{/if}
{if $permissions.edit == 1}
{icon class=add action=create title="Add a new product" text="Add a New Product"}
{/if}
{/permissions}
{/if}

<div class="bodycopy">{$current_category->body}</div>

{if $categories|@count > 0}
<hr/>
<div class="cats">
<h2>Categories Under {$current_category->title}</h2>
{foreach name="cats" from=$categories item="cat"}
{if $cat->is_active==1 || $user->isAdmin()}
{counter assign=iteration}
{if $iteration%2==0}
{assign var="positioninfo" value=" last-in-row"}
{else}
{assign var="positioninfo" value=""}
{/if}

<div class="cat{$positioninfo}{if $cat->is_active!=1} inactive{/if}">
{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
<div class="item-actions">
{if $permissions.edit == 1}
{icon controller=storeCategory action=edit record=$cat title="Edit `$cat->title`"}
{/if}
{if $permissions.delete == 1}
{icon controller=storeCategory action=delete record=$cat title="Delete `$cat->title`" onclick="return confirm('Are you sure you want to delete this category?');"}
{/if}
</div>
{/permissions}
<a href="{link controller=store action=showall title=$cat->sef_url}" class="cat-img">
{if $cat->expFile[0]->id}
{img file_id=$cat->expFile[0]->id w=100 class="cat-image"}
{else}
{img file_id=$page->records[0]->expFile.mainimage[0]->id w=100 class="cat-image"}
{/if}
<h3>{$cat->title}</h3>
</a>
</div>
{/if}
{/foreach}
<div style="clear:both"></div>
</div>
{/if}
<!--hr/-->
<h2>All Products Under {$current_category->title}</h2>
{pagelinks paginate=$page top=1}
{*control type="dropdown" name="sortme" items=$page->sort_dropdown default=$defaultSort*}

{*script unique="sort-submit"}
{literal}
YUI({ base:EXPONENT.URL_FULL+'external/yui3/build/',loadOptional: true}).use('node', function(Y) {
Y.all('select[name="sortme"]').on('change',function(e){
window.location = e.target.get('value');
});
});
{/literal}
{/script*}

<div class="products">
{foreach from=$page->records item=listing name=listings}

{if $smarty.foreach.listings.iteration%3==0}
{assign var="positioninfo" value=" last-in-row"}
{else}
{assign var="positioninfo" value=""}
{/if}

<div class="product{$positioninfo}">
{include file=$listing->getForm('storeListing')}
</div>

{if $positioninfo!="" || $smarty.foreach.listings.last==true}
<div class="break">&nbsp;</div>
{/if}

{/foreach}
</div>
{*control type="dropdown" name="sortme" items=$page->sort_dropdown default=$defaultSort*}
{pagelinks paginate=$page bottom=1}
</div>


{script unique="expanding-text" yui3mods="yui"}
{literal}
YUI().use("anim-easing","node","anim", function(Y) {
var modules = Y.all('.showall.store .bodycopy');
modules.each(function(n,k){
// add fx plugin to module body
var content = n.one('.more-text');
if (!Y.Lang.isNull(content)) {
content.plug(Y.Plugin.NodeFX, {
to: { height: 0 },
from: {
height: function(node) { // dynamic in case of change
return node.get('scrollHeight'); // get expanded height (offsetHeight may be zero)
}
},

easing: Y.Easing.easeOut,
duration: 0.5
});

var onClick = function(e) {
e.halt();
n.toggleClass('yui-closed');
content.fx.set('reverse', !content.fx.get('reverse')); // toggle reverse
content.fx.run();
};

var control = n.one('.toggle');
control.on('click', onClick);
//n.one('.more-text .close').on('click', onClick);
};
});

});
{/literal}
{/script}
{*
* Copyright (c) 2007-2008 OIC Group, Inc.
* Written and Designed by Adam Kessler
*
* This file is part of Exponent
*
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* GPL: http://www.gnu.org/licenses/gpl.txt
*
*}

{css unique="storeListing" link="`$asset_path`css/storeListing.css"}

{/css}



<div class="module store showall">

{if $moduletitle}<h1>{$moduletitle}</h1>{/if}
<h1>
<span>{$current_category->title}</span>
{if $current_category->expFile[0]->id}
{img file_id=$current_category->expFile[0]->id w=600 h=100 zc=1}
{/if}
</h1>
{if $current_category->id}
{permissions}
{if $permissions.edit == 1}
{icon action=edit module=storeCategory record=$current_category title="Edit `$current_category->title`" text="Edit this Store Category"}{br}
{/if}
{*if $permissions.manage == 1}
{icon action=configure module=storeCategory record=$current_category title="Configure `$current_category->title`" text="Configure this Store Category"}{br}
{/if*}
{*if $permissions.manage == 1}
{icon action=configure module=ecomconfig hash="#tab2" title="Configure Categories Globally" text="Configure Categories Globally"}{br}
{/if*}
{if $permissions.manage == 1 && $config.orderby=="rank"}
{ddrerank label="Products" sql=$rerankSQL model="product" controller="storeCategory" id=$current_category->id}
{/if}
{if $permissions.edit == 1}
{icon class=add action=create title="Add a new product" text="Add a New Product"}
{/if}
{/permissions}
{/if}

<div class="bodycopy">{$current_category->body}</div>

{if $categories|@count > 0}
<hr/>
<div class="cats">
<h2>Categories Under {$current_category->title}</h2>
{foreach name="cats" from=$categories item="cat"}
{if $cat->is_active==1 || $user->isAdmin()}
{counter assign=iteration}
{if $iteration%2==0}
{assign var="positioninfo" value=" last-in-row"}
{else}
{assign var="positioninfo" value=""}
{/if}

<div class="cat{$positioninfo}{if $cat->is_active!=1} inactive{/if}">
{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
<div class="item-actions">
{if $permissions.edit == 1}
{icon controller=storeCategory action=edit record=$cat title="Edit `$cat->title`"}
{/if}
{if $permissions.delete == 1}
{icon controller=storeCategory action=delete record=$cat title="Delete `$cat->title`" onclick="return confirm('Are you sure you want to delete this category?');"}
{/if}
</div>
{/permissions}
<a href="{link controller=store action=showall title=$cat->sef_url}" class="cat-img">
{if $cat->expFile[0]->id}
{img file_id=$cat->expFile[0]->id w=100 class="cat-image"}
{else}
{img file_id=$page->records[0]->expFile.mainimage[0]->id w=100 class="cat-image"}
{/if}
<h3>{$cat->title}</h3>
</a>
</div>
{/if}
{/foreach}
<div style="clear:both"></div>
</div>
{else}
<!--hr/-->
<h2>All Products Under {$current_category->title}</h2>
{pagelinks paginate=$page top=1}
{*control type="dropdown" name="sortme" items=$page->sort_dropdown default=$defaultSort*}

{*script unique="sort-submit"}
{literal}
YUI({ base:EXPONENT.URL_FULL+'external/yui3/build/',loadOptional: true}).use('node', function(Y) {
Y.all('select[name="sortme"]').on('change',function(e){
window.location = e.target.get('value');
});
});
{/literal}
{/script*}

<div class="products">
{foreach from=$page->records item=listing name=listings}

{if $smarty.foreach.listings.iteration%3==0}
{assign var="positioninfo" value=" last-in-row"}
{else}
{assign var="positioninfo" value=""}
{/if}

<div class="product{$positioninfo}">
{include file=$listing->getForm('storeListing')}
</div>

{if $positioninfo!="" || $smarty.foreach.listings.last==true}
<div class="break">&nbsp;</div>
{/if}

{/foreach}
</div>
{*control type="dropdown" name="sortme" items=$page->sort_dropdown default=$defaultSort*}
{pagelinks paginate=$page bottom=1}
{/if}
</div>


{script unique="expanding-text" yui3mods="yui"}
{literal}
YUI().use("anim-easing","node","anim", function(Y) {
var modules = Y.all('.showall.store .bodycopy');
modules.each(function(n,k){
// add fx plugin to module body
var content = n.one('.more-text');
if (!Y.Lang.isNull(content)) {
content.plug(Y.Plugin.NodeFX, {
to: { height: 0 },
from: {
height: function(node) { // dynamic in case of change
return node.get('scrollHeight'); // get expanded height (offsetHeight may be zero)
}
},

easing: Y.Easing.easeOut,
duration: 0.5
});

var onClick = function(e) {
e.halt();
n.toggleClass('yui-closed');
content.fx.set('reverse', !content.fx.get('reverse')); // toggle reverse
content.fx.run();
};

var control = n.one('.toggle');
control.on('click', onClick);
//n.one('.more-text .close').on('click', onClick);
};
});

});
{/literal}
{/script}

0 comments on commit 87ce25b

Please sign in to comment.