Jump to content



Member Since 16 Feb 2010
Offline Last Active Aug 16 2010 03:25 PM

Topics I've Started

$items variable and List Objects

28 April 2010 - 04:43 PM

Hi everyone,

So I am trying to make heads or tails of the whole Hook (both TH and CH) infrastructure, and after reading through numerous posts, I think I am making some headway (thanks to everyone's diligent efforts). I am now comfortable using pre/override/post Template hooks, and I have no problem adding my own /addons/my_changes/blocks - for the most part.

Here is where I am running into an issue. I want to display my product filters using an entirely separate code. What I originally did was to place a new file titled "product_filters_custom.tpl" in the skins/electro/blocks folder. In the blocks manager I can go to Block Content: List Objects > Product Filters and then Product Filters: Dynamic and voila, in Appearance Type I see "Custom" and it works perfectly. But I do not want to keep ANY code in the regular blocks folder, I want everything to be in addons/my_changes so that I won't run into upgrade problems.

When I move the IDENTICAL file to addons/my_changes/blocks two things happen:
#1 - The custom addon is no longer available under the Block Content: List Objects > Product Filter, but rather as a Standard Sidebox > Custom. That is okay to me; however,
#2 - now the $items variable is not usable I guess because this is no longer a List Object. Strangely though, I cannot find where the $items variable is set - using Smarty Debug it doesn't appear to be passed even to the regular Product Filters.

So I guess my question can lead down many different avenues that may contain an answer/solution:
1) Am I trying to add this block improperly? If so, what is the proper way?
2) If not, how can I add a block in addons/my_changes so that it is a list object?
3) If I can't, where is the the $items smarty variable set (I honestly grepped and couldn't find it) and how can I best pass this to my new block?

Thanks in advance, if it weren't for these forums I don't know how I would be even this far along.

Submit main_login_form with AJAX

13 April 2010 - 04:40 AM

So I'm trying to submit the login form in the background using AJAX but am having little to no luck. Essentially what I'm trying to do is to log into my store from another part of my site running under my CMS.

When I write up the HTML for the form with the same elements and hit submit, everything works fine. With the return_url argument I even come back right to the page where I started as if I never left. You can immediately see that a cookie has been set and if you navigate to the store you are logged in with no issues.

Take that same exact code and bind the submit button to jquery and send it in the background using an AJAX POST method and you get a 404 on /store/index.php.

Any thoughts? Are there better ways to do this to begin with? Also are there any AJAX log in mods, maybe I can look at how they have done it.



Get a list of subcategories

25 February 2010 - 07:30 AM

How do I get a list of all subcategories?

I'm ok with it either being a categories block that is limited to level != 0 or a custom block, but I just want to display a list of subcategories (of the current category I am viewing) in a sidebox.


How to include external library in scripts.tpl

22 February 2010 - 10:39 PM

I'd like to add a google api framework library from the web. I've added it to common_templates/scripts.tpl below the following code:

{script src="lib/jquery/jquery.js"}
{script src="js/core.js"}
{script src="js/ajax.js"}

{script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"}

In this example it's jquery, but that's of non consequence. When I do this, what ends up getting added in the html is:

<script type="text/javascript" src="/store/http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

I've tried a bunch of different things but cannot get it to not add the "/store/" before any address I put.

How do I get it to look to the web instead of a relative directory structure?