Same banner - Multiple Categories

Modules, Add-ons and custom code that's more than just a quick hack or Mod.
Post Reply
Iamdbat
Posts: 66
Joined: Sun Oct 18, 2009 1:47 am

Same banner - Multiple Categories

Post by Iamdbat »

How can you use the same banner - say an affiliated banner on numerous categories - As it stands with ISC you can only allocate a new or existing banner to one category only

But what if you want to use the same banner for a top level category and its sub categories

Do you have to create the same banner for each category ?????????!*&^:F?

Thanks in advance for any input
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Same banner - Multiple Categories

Post by Painstik »

Yes you will have to make banner for each category :) Just like me... :(

I will try to make that fix, but atm I am working on product search trying to fix that idiotic search engine
Need custom coding for Interspire Shopping Cart? Contact me
novista
Confirmed
Confirmed
Posts: 89
Joined: Fri Jul 03, 2009 11:22 pm

Re: Same banner - Multiple Categories

Post by novista »

You could also create a new panel, place your banner info there then add %%panel.panelname%% to you category layout.
Michael Kopel
NovistaWeb.com
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Same banner - Multiple Categories

Post by Painstik »

novista wrote:You could also create a new panel, place your banner info there then add %%panel.panelname%% to you category layout.
Allready thought about that, but like that banner would be on all categories and that is not an option I need.
Need custom coding for Interspire Shopping Cart? Contact me
Iamdbat
Posts: 66
Joined: Sun Oct 18, 2009 1:47 am

Re: Same banner - Multiple Categories

Post by Iamdbat »

As painstik says - It's an ... well not an oversight on behalf of Interspire but something that needs to improved - I suggest if anyone is interested to go to the ideas lab and vote for it
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Same banner - Multiple Categories

Post by Painstik »

I have some small changes for creating multiple banners (this is solution for now, but in the future there will be made a much better banner administration)

Open: admin/templates/banner.form.html
Find:

Code: Select all

								<select name="bannercat" id="bannercat" class="Field200">
									<option value="">%%LNG_ChooseACategory%%</option>
									%%GLOBAL_CategoryOptions%%
								</select>
Replace with:

Code: Select all

								<select name="bannercat[]" id="bannercat" multiple="bannerCatArray" class="Field200">
									<option value="">%%LNG_ChooseACategory%%</option>
									%%GLOBAL_CategoryOptions%%
								</select>
Find:

Code: Select all

								<select name="bannerbrand" id="bannerbrand" class="Field200">
									<option value="">%%LNG_ChooseABrand%%</option>
									%%GLOBAL_BrandOptions%%
								</select>
Replace with:

Code: Select all

								<select name="bannerbrand[]" id="bannerbrand" multiple="bannerBrandArray" class="Field200">
									<option value="">%%LNG_ChooseABrand%%</option>
									%%GLOBAL_BrandOptions%%
								</select>
Open: admin/includes/classes/class.banners.php
Find:

Code: Select all

			$category = (int)$_POST['bannercat'];
			$brand = (int)$_POST['bannerbrand'];
Replace with:

Code: Select all

			$category = $_POST['bannercat'];
			$brand = $_POST['bannerbrand'];
Find:

Code: Select all

				"catorbrandid" => $catorbrandid,
Replace with (comment) or delete:

Code: Select all

//				"catorbrandid" => $catorbrandid,
Find:

Code: Select all

			// Creating a new banner
			if ($ExistingBannerId == 0) {
				return $GLOBALS['ISC_CLASS_DB']->InsertQuery("banners", $banner);
			}
Replace with (comment) or delete:

Code: Select all

//			if ($ExistingBannerId == 0) {
//				return $GLOBALS['ISC_CLASS_DB']->InsertQuery("banners", $banner);
//			}
Find:

Code: Select all

// Updating an existing banner
			else {
				if ($GLOBALS['ISC_CLASS_DB']->UpdateQuery("banners", $banner, "bannerid='".$GLOBALS['ISC_CLASS_DB']->Quote((int)$ExistingBannerId)."'")) {
					return $ExistingBannerId;
				}
				else {
					return false;
				}
			}
Replace with:

Code: Select all

// Updating an existing banner
				$deleteQuery = "WHERE name='".$name."'";
				$GLOBALS['ISC_CLASS_DB']->DeleteQuery('banners', $deleteQuery);
				for($i=0; $i<count($catorbrandid); $i++)
				{
					$banner['catorbrandid'] = (int)$catorbrandid[$i];
					if(!$GLOBALS['ISC_CLASS_DB']->InsertQuery("banners", $banner))
					{
						return false;
					}
				}
				return true;

Now you can make banners for multiple categories/brands, this is temporary solution, i hope there will be new solution soon with lots of new stuff for banner administration...
Need custom coding for Interspire Shopping Cart? Contact me
Iamdbat
Posts: 66
Joined: Sun Oct 18, 2009 1:47 am

Re: Same banner - Multiple Categories

Post by Iamdbat »

I think right or left hand banners would be a good idea as opposed to trying to create new panels and layouts for different parent categories - It would make a lot more sense I think just to be able to place a new banner into a single right hand or left hand panel than have a server request for new layouts all the time - just my 2 cents but I think Interspire engineers should look into the prospect
grantg
Posts: 112
Joined: Thu Oct 08, 2009 11:01 am

Re: Same banner - Multiple Categories

Post by grantg »

I assume this works by pressing Ctrl and clicking on the categories in the list? Unfortunately I have selected a few categories and the banner is no longer shown on any of the categories at all, using ISC 5.5.2. Could this be updated? I don't know why it doesn't work...the banner code hasn't changed between 506 and 552 :?

Edit: New banners are not being saved (nothing in the database) - if I edit an existing banner and then save it, it deletes itself.
Cupar Garden Centre: CS-Cart Professional 2.2.5 (Converted from ISC 6.0.14 Ultimate)
Online Garden Centre: ISC 6.0.14 Professional
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Same banner - Multiple Categories

Post by Painstik »

When you check them, they are showing on your pages, but they are not comited to databese so they are not selected in admin. This was a quick fix for the problem.

I am sorry, but i am not using new version of isc.
Need custom coding for Interspire Shopping Cart? Contact me
grantg
Posts: 112
Joined: Thu Oct 08, 2009 11:01 am

Re: Same banner - Multiple Categories

Post by grantg »

After I applied your modifications, I edited a working banner and changed the categories, so the banner would show on 4 different categories, when I clicked save, it actually deleted the existing banner. New banners do not work if they are to be shown on one or more Brand or Categories.

If you are not intending to upgrade....could you do this on our test site for $?

Thanks
Cupar Garden Centre: CS-Cart Professional 2.2.5 (Converted from ISC 6.0.14 Ultimate)
Online Garden Centre: ISC 6.0.14 Professional
Post Reply