941-685-8851

February, 2010

Magento: add sku to cart

On the Magento cart page, to display the product sku along with the product name and details:

edit the pag: app/design/default/yourtheme/template/checkout/cart/item/default.phtml

The following code will add the sku to the cart page. It will also add custom option sku definitions;

<div><em>Product #:</em> <?php if (is_object($this->getChildProduct())):
echo $this->getChildProduct()->getSku();
else:
echo $_item->getSku();
endif; ?>
</div>

Here is a sample of where the code should go:

<?php $_item = $this->getItem()?>
<tr>
<td><a href=”<?php echo $this->getDeleteUrl() ?>”><img src=”<?php echo $this->getSkinUrl(‘images/btn_trash.gif’) ?>” width=”16″ height=”16″ alt=”<?php $this->__(‘Remove item’)?>” /></a></td>
<td><a href=”<?php echo $this->getProductUrl() ?>”><img src=”<?php echo $this->getProductThumbnail()->resize(75); ?>” alt=”<?php echo $this->htmlEscape($this->getProductName()) ?>” width=”75″ /></a></td>
<td>
<h4><a href=”<?php echo $this->getProductUrl() ?>”><?php echo $this->getProductName() ?></a></h4>

<!– Code goes here to display directly under the product name–>

<div><em>Product #:</em> <?php if (is_object($this->getChildProduct())):
echo $this->getChildProduct()->getSku();
else:
echo $_item->getSku();
endif; ?>
</div>
<!– item custom options –>

The product sku will now be displayed on the cart page along with the added products.

Share
 

Puncutation Names and aliases

The following is a list of common keyboard punction symbols, with their proper name and common alias names.

Names of punctuation
Space blank, ghost (NetHack)
! Exclamation point exclamation (mark), (ex)clam, excl, wow, hey, boing, bang, shout, yell, shriek, pling, factorial, ball-bat, smash, cuss, store, potion (NetHack), not (UNIX) (C), dammit (UNIX)
Quotation mark (double) quote, dirk, literal mark, rabbit ears, double ping, double glitch, amulet (NetHack), web (NetHack), inverted commas
# Crosshatch pound, pound sign, number, number sign, sharp, octothorpe, hash, (garden) fence, crunch, mesh, hex, flash, grid, pig-pen, tictactoe, scratch (mark), (garden) gate, hak, oof, rake, sink (NetHack), corridor (NetHack), unequal, punch mark
$ Dollar Sign dollar, cash, currency symbol, buck, string, escape, ding, big-money, gold (NetHack), Sonne
% Percent Sign percent, mod (C), shift-5, double-oh-seven, grapes, food (NetHack)
& Ampersand and, amper, address (C), shift-7, andpersand, snowman, bitand (C), donald duck, daemon (NetHack), background (UNIX), pretzel
Apostrophe (single) quote, tick, prime, irk, pop, spark, glitch, lurker above (NetHack)
* Asterisk star, splat, spider, aster, times, wildcard (UNIX), gear, dingle, (Nathan) Hale, bug, gem (NetHack), twinkle, funny button, pine cone, glob (UNIX)
() Parentheses parens, round brackets, bananas, ears, bowlegs
( Left Parenthesis (open) paren, so, wane, parenthesee, open, sad, tool (NetHack)
) Right Parenthesis already, wax, unparenthesee, close (paren), happy, thesis, weapon (NetHack)
+ Plus Sign plus, add, cross, and, intersection, door (NetHack), spellbook (NetHack)
, Comma tail, trapper (NetHack)
- Hyphen minus (sign), dash, dak, option, flag, negative (sign), worm, bithorpe
. Period dot, decimal (point), (radix) point, spot, full stop, put, floor (NetHack)
/ Slash stroke, virgule, solidus, slant, diagonal, over, slat, slak, across, compress, reduce, replicate, spare, divided-by, wand (NetHack), forward slash, shilling
: Colon two-spot, double dot, dots, chameleon (NetHack)
; Semicolon semi, hybrid, giant eel (NetHack), go-on
<> Angle Brackets angles, funnels, brokets, pointy brackets, widgets
< Less Than less, read from (UNIX), from (UNIX), in (UNIX), comesfrom (UNIX), crunch, sucks, left chevron, open pointy (brack[et]), bra, upstairs (NetHack), west, (left|open) widget
> Greater Than more, write to (UNIX), into/toward (UNIX), out (UNIX), gazinta (UNIX), zap, blows, right chevron, closing pointy (brack[et]), ket, downstairs (NetHack), east, (right|close) widget
= Equal Sign equal(s), gets, becomes, quadrathorpe, half-mesh, ring (NetHack)
? Question Mark question, query, whatmark, what, wildchar (UNIX), huh, ques, kwes, quiz, quark, hook, scroll (NetHack), interrogation point
@ At Sign at, each, vortex, whirl, whirlpool, cyclone, snail, ape (tail), cat, snable-a, trunk-a, rose, cabbage, Mercantile symbol, strudel, fetch, shopkeeper (NetHack), human (NetHack), commercial-at, monkey (tail)
[] Brackets square brackets, U-turns, edged parentheses
[ Left Bracket bracket, bra, (left) square (brack[et]), opensquare, armor (NetHack)
] Right Bracket unbracket, ket, right square (brack[et]), unsquare, close, mimic (NetHack)
\ Backslash reversed virgule, bash, (back)slant, backwhack, backslat, escape (UNIX), backslak, bak, scan, expand, opulent throne (NetHack), slosh, slope, blash
^ Circumflex caret,
carrot, (top)hat, cap, uphat, party hat, housetop, up arrow, control,
boink, chevron, hiccup, power, to-the(-power), fang, sharkfin, and, xor (C), wok, trap (NetHack), pointer, pipe (UNIX), upper-than
_ Underscore underline, underbar, under, score, backarrow, flatworm, blank, chain (NetHack), gets, dash, sneak
` Grave (grave/acute)
accent, backquote, left/open quote, backprime, unapostrophe, backspark,
birk, blugle, backtick, push, backglitch, backping, execute, boulder (NetHack), rock (NetHack), blip
{} Braces curly braces, squiggly braces, curly brackets, squiggle brackets, Tuborgs, ponds, curly chevrons, squirrly braces, hitchcocks, chippendale brackets
{ Left Brace brace, curly, leftit, embrace, openbrace, begin (C), fountain (NetHack)
} Right Brace unbrace, uncurly, rytit, bracelet, close, end (C), a pool (NetHack)
| Vertical Bar pipe (UNIX), pipe to (UNIX), vertical line, broken line, bar, or (C), bitor (C), vert, v-bar, spike, to (UNIX), gazinta (UNIX), thru (UNIX), pipesinta (UNIX), tube, mark, whack, gutter, wall (NetHack)
~ Tilde twiddle, tilda, tildee, wave, squiggle, swung dash, approx, wiggle, enyay, home (UNIX), worm, not (C)
Share
 

Magento: remove register from checkout

Regarding the use of accounts and forcing customers to check out as guests, the folowing solution works in 1.3.x.

Edit:  /app/design/frontend/default/detault/layout/checkout.xml

Comment out the reference to the “checkout.onepage.login” addLink under the checkout_onepage_index section.

<!-- <block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml"/> -->

Edit:  /app/design/frontend/default/default/template/checkout/onepage.phtml , replace the Script section at the bottom of the page, add after the </ol>.

<input type="hidden" name="checkout_method" id="login:guest" checked="checked" value="guest"/>
<script type="text/javascript">
//<![CDATA[
var accordion = new Accordion('checkoutSteps', '.head', true);
<?php if($this->getActiveStep()): ?>
accordion.openSection('opc-billing');
<?php endif ?>

var checkout = new Checkout(accordion,{
progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
saveMethod: '<?php echo
$this->getUrl('checkout/onepage/saveMethod') ?>',
failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
);
var cb = $("login:guest");
cb.checked = true;
checkout.setMethod();
//]]>
</script>

That will remove the register section from the checkout accordion.
To remove
Share