• Apr.
  • 15.
  • 2012

Ways to add social buttons to LightSpeed Webstore

When it comes to adding social sharing buttons to LightSpeed webstore you can choose a quick and easy fix like Sharethis or add the buttons manually. If you use Sharethis you can customize the buttons. If you add the button using the site’s button code you have to use that site’s button style. This rule is usually laid out in black and white on the site’s terms of use page. Sharethis’ look and behavior is not to everyone’s taste but it is a heck of a lot easier to use.

Most clients want the usual suspects: Twitter and Facebook. Other clients want Pinterest as well and then there’s Svpply.

The Svpply social sharing button is not a common request from clients. Only one client has asked me to add the button to their webstore. So I got the code from the Svpply site and added it and styled it, case closed. Soon after I heard from the client that nothing was happening when they clicked the button. So I had to check out why.

To my knowledge Svpply is a relatively new social sharing site. Because it’s so new hardly anyone is using it and I couldn’t find any information on adding the Svpply button. The Svpply website is the only place to go for help. Their tech support probably would have tried to help me but I really didn’t feel like explaining how webstore shows product images and why their button wasn’t working on my project.

Svpply posts won’t work if the code in the button can’t find the product image. Webstore’s product image (in the single product details pages) is not an actual inline image; it’s a background image. So that is why the Svpply code can’t find it. And that is why the button didn’t work out of the box.

In your webstore template find the product image tag (in product_details.tpl.php), it looks like this:

<?php $this->pnlImgHolder->Render(); ?>

You can get the main product image to display as an inline image with this code:

<img src="index.php?pdetailimage=<?php echo ($this->prod->ImageId)?>.jpg" alt=""/>

When I customize a webstore I usually wrap the Product Image tag with a div (for long and boring Internet Explorer related reasons) so all I needed was to add the second line of HTML containing the inline image.jpg and give that one a z-index less than the div that wraps the product image tag.

I gave div#imgHolder a higher z-index (z-index:2).
I gave div#inlineImage z-index:1. As far as the Svpply button is concerned there’s now an inline image on the page.

Here’s the HTML:

<div class="imgHolder"><?php $this->pnlImgHolder->Render(); ?></div>
<div class="inlineimage"><img src="index.php?pdetailimage=<?php echo ($this->prod->ImageId)?>.jpg" alt="" title=""/></div>

The downside is that no matter what image is being highlighted by the Svpply button, only the main product image will get posted on Svpply. Visitors using the button might choose a detail image and wonder why that image doesn’t show up. But I’m confident that it won’t cause any riots.

<div id="supply"  class="social_button">
<script src="//svpply.com/api/all.js#xsvml=1" type="text/javascript" ></script>
<sv:product-button type="boxed" ></sv:product-button>
</div>

Pinterest’s button code requires a complete URL for the product and the product image.
This code gets the large size of the main product image which will look better on a board than a little thumbnail-sized image.

Make sure to replace http://www.mywebstore.com/ with the real domain and path to webstore.
Example, if your domain is superfab.com and your store is located at superfab.com/store/ you’d need to add http://www.superfab.com/store/.
If your store is in the domain root just add http://www.superfab.com/. If you’re hosting with LightSpeed your store is in the root.

<div id="pinterest"  class="social_button">
<a href="http://pinterest.com/pin/create/button/?url=http://www.mywebstore.com/index.php?product=<?php echo($this->prod->Code)?>&amp;media=http://www.mywebstore.com/index.php?pdetailimage=<?php echo ($this->prod->ImageId)?>.jpg" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
</div>

Twitter’s button code requires a complete URL for the link to the product in the tweet.
Make sure to replace http://www.mywebstore.com/ with the real domain and path to webstore.
Example, if your domain is superfab.com and your store is located at superfab.com/store/ you’d need to add http://www.superfab.com/store/.
If your store is in the domain root just add http://www.superfab.com/. If you’re hosting with LightSpeed your store is in the root.

<div id="twitter" class="social_button">
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.mywebstore.com/index.php?product=<?php echo($this->prod->Code)?>" data-text="<?= $this->prod->DescriptionShort ?>" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>

Facebook’s button code is hard to add to webstore only because the default width is 450 pixels and most webstore product details containing divs don’t have that much room to devote. It also makes it hard to show the Facebook button in a row of other buttons.Thankfully other buttons are not wide.The width of the Facebook button might be why most designers put it last in the row. You can make the button width a lot smaller though – here I’ve made it 150 pixels. It will work ok if your template’s containing div isn’t using overflow:hidden. When I write “button width” I’m not referring to the image of the button.

<div id="facebook" class="social_button">
<fb:like href="index.php?product=<?php echo($this->prod->Code)?>" send="false"  width="150" show_faces="false" layout="button_count" font="lucida grande"></fb:like>
</div><script src="https://connect.facebook.net/en_US/all.js#xfbml=1"></script>

Facebook needs 1 additional javascript file at the bottom of product_details.tpl.php after all the rest of the code in that file.

<script type="text/javascript">
FB.init({
status : true,
cookie : true,
xfbml  : true
});
</script>
279 views Posted in Lightspeed Webstore, Technical Blog | Tagged , | Leave a comment
  • Mar.
  • 29.
  • 2012

Launched Projects

Even though my home page has had the same launched project on it for almost a year it I’ve launched or helped launch quite a few new sites since that one:

www.coldspringapothecary
www.lovepiccolini.com
www.on0n.com
www.m3babygifts.com
www.tlroom.com
www.ninaloren.com
www.thomassires.com
www.statenislandoutloud.org

There are lots more in the works,too. I have 3 or 4 that just haven’t gone public for other reasons but the sites have been completed.

126 views Posted in Technical Blog | Leave a comment
  • Mar.
  • 29.
  • 2012

SEO for the very, very nervous

There are countless companies out there just waiting to sell you this mysterious SEO that you’ve heard so much about. What they won’t tell you is that reading content that was created for SEO and only for SEO is a hollow (and sometimes confusingly dis-jointed) experience for the end consumer/user. An SEO might tell you how to write for better rankings but they probably won’t tell you how to write more interesting things people will want to read. That part is actually a lot easier than you might think, you just have to write like a human being.

For those who prefer to embark with integrity, SEO is set of basic steps anyone with a little know how can take to improve the chances of their relevant content getting fairer placement in Search Engine Result Pages.

For the unscrupulous, it’s a sneaky bag of tricks to push any content, relevant or completely otherwise to the top of the SERPS.

I do not think content that doesn’t matter should be boosted over content that does. The problem is everyone thinks their content matters. Especially when they have very little of it but demand to place before their competitors who’ve been creating relevant content for years. And even more especially when they can barely write a sentence without 5 spelling mistakes.

Privacy on
I mainly create my sites with WordPress. When I’m working on a new WordPress site I keep the Privacy settings turned on. This keeps the site from being indexed by search engines before we’re ready to go live. Doing that means the site’s pages won’t get crawled while we’re renaming,changing or trashing content in the development stages. So robots and spiders and etc will not “see” the site while it is not ready and as it follows, humans won’t either. The second the site is ready to launch I immediately take the site out of Privacy mode.

The Basics
Heading Architecture: search engines like pages that have heading tags where they’re supposed to be in a logical order. Think of Headings as a way to direct the bots through your text content. h1 should be used for the element on the page that is the most important – like the page title. If you use the h1 tag in order to have larger text just to have larger text – you should ask your designer to provide you with a workaround so you can have larger text without using the h1 heading everywhere.
Titles:relevant to actual page (text) content.
Meta descriptions:relevant to actual page (text) content – usually less than 160 chars but can go up to 200 or 250 depending on the crawler/bot.
Meta tags: no one pays any attention you might as well forget about them,too.
Image alt and title tags: describe the image and/or the context the image is being used.
Whether to use the no follow attribute on links to external sites. A lot of fuss is made over this one. People toss terms like link juice around.
Manipulating PageRank: “Google is concerned about webmasters who try to game the system, and thereby reduce the quality and relevancy of Google search results” – from Wikipedia.

Popular/Buzz
Sites that get traffic get more attention/buzz and are considered popular. Popular sites will get to the SERPs before the site that you launched 3 months ago and then never updated. But if the site that you neglected is also a popular site it will stay on the top until a site with similar content is deemed more popular. Sites that get updated frequently with relevant content are more likely to be popular.If you site is not popular but it offers new and exciting content that hardly anyone else is offering, take heart. If you keep it up you’ll be popular. Another thing that gets bots excited is if the site is very new. New content! Slurp,slurp.

Niche me
You’ve heard the following phrase before and you’ll hear it again: The Importance of Creating a Niche or Having a Niche or Establishing a Niche
Niche: The more specialized your content the more likely your site can be popular. But because there are so many web sites and so many of them are all about the same thing it is ever more difficult to distinguish your site among other similar sites. Because you’re all selling or writing about the same thing. Luckily you’re given many ways to help distinguish your site from your competitor’s sites, see The Basics.

Tables for layout vs. Table-less
I’ve seen tables for layout sites at the top of the SERPs. I’ve seen table-less sites there, too. My opinion is that if a tables for layout site has the most relevant content based on the search term or keyword,is of a good reputation and it has been around awhile it will place fine despite its being made up of tables. The argument against tables(in terms of SEO) is that the less HTML the better so search bots and crawlers can read relevant text content rather easier without there being a soup of tables to sift through. But table less sites can have HTML bloat,too. It’s called div-itis. So just because you don’t use tables for layout doesn’t mean you have less HTML (although it’s pretty freaking likely. I mean, have you ever seen the backend of one of these horrors?).

I’m no expert. But I do build websites for my job. So I guess I think I know stuff.

177 views Posted in Technical Blog | Tagged | Leave a comment
  • Dec.
  • 17.
  • 2011

Importing Google Web Fonts, LightSpeed Web Store & SSL

As I am sure you know, SSL is very sensitive. Every link href, script src and img src in the document must be HTTPS for the page to be delivered completely secure.

If not, the encryption is partial and you may receive warnings about it. Worse, your customers will see warnings about it and might leave your site before buying or registering. So it’s better to never to let this happen, if possible. Especially in a production site (live). Goes without saying, I guess.

Anyway my latest thing is using Google Web Fonts because although I worship, love and adore WP-Cufon and Cufon and usually use them whenever I can I can’t use Cufon site-wide. Well, I could but not in good conscience if I care about how long the page takes to load and all of that.

Most of my clients choose 1 Universally available font for their main Body font and a couple of Specialty fonts for titles,headings and menus, to dress things up a bit. But my latest client wanted a Specialty font for their main Body font and so I found 3 compatible fonts in Google Web Font’s library. I used the @import in my main stylesheet and thought everything was going rather well.
Until we had to start checking SSL and wouldn’t you know it it wasn’t kicking in all the way.
Something was not getting encrypted and I could not figure out what it was.

Like I do whenever this kind of thing happens I reverted the template back to a default Web store Template and SSL kicked in all the way. After I looked through my customized files I still couldn’t find anything off…

Then I checked my main stylesheet and at the top was:

@import url(http://fonts.googleapis.com/css?family=Rokkitt:400,700);
@import url(http://fonts.googleapis.com/css?family=Alice);
@import url(http://fonts.googleapis.com/css?family=Kameron:400,700);

AHA! I switched it to:

@import url(https://fonts.googleapis.com/css?family=Rokkitt:400,700);
@import url(https://fonts.googleapis.com/css?family=Alice);
@import url(https://fonts.googleapis.com/css?family=Kameron:400,700);

And SSL kicked in all the way. JOY.

So don’t be silly like me. If you import fonts like this make sure the url is https. Good thing Google has SSL up the wazoo so this is not a problem. Awesome.

982 views Posted in Lightspeed Webstore, Technical Blog | Tagged , , , , , , | Comments Off