Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Swipestripe extending category


Go to End


6 Posts   3135 Views

Avatar
isolated

Community Member, 28 Posts

13 January 2014 at 5:09am

Hi,

so i was trying to extend category with a possibility to have filtering for products (products additionally were extended with attributes i want to do filtering).

However i came with few problems.
First, including "include Filters" in the ProductCategory.ss, which was not possible to locate such an include. Flush was done multiple times, however i still cannot make include Filters.ss with a single string in it "testing filters".

Any ideas, why it might not locate such include?

Avatar
frankmullenger

Forum Moderator, 53 Posts

28 January 2014 at 9:35pm

Hi,

You might want to try copying the ProductCategory.ss into your theme include folder, then including Filters.ss and try the flush again. If that is what you are currently doing perhaps bang ?showtemplate=1 on the end of the URL to see what templates are being used. Perhaps the template in the silverstripe-category/ module is still being used for some reason?

Avatar
isolated

Community Member, 28 Posts

14 March 2014 at 12:54am

Edited: 14/03/2014 1:59am

ok, finally got working this.

Has anyone done any custom product filtering, i.e. using a form with dropdownfield?
I tried extending productCategory by using a filter/form, however i could not get it working, all products are shown even though filtering options are selected.

If you have any ideas, would be interesting to see (if you know a good manual on this topic, would be good as well).
saulius at myeweb.com (you can contact me for further details/link for example )

Avatar
isolated

Community Member, 28 Posts

16 March 2014 at 12:11am

so went one step further. Now i'm stuck at url look after product search. Is there a way how to customize url so as there was no /formAction in the url?

Avatar
Webdoc

Community Member, 349 Posts

23 September 2015 at 9:37am

Edited: 23/09/2015 9:47am

Hi i was wondering is there any possible way to add Category Icon as a upload field to Swipestripe category.
Added the has one:
private static $has_one = array(
'Caticon' => 'Image'
);
also the field:
$fields->addFieldToTab('Root.Main', new UploadField('Caticon', 'Category icon'));

But no success. it creates tables but dont add the image upload field to the category admin page.
Added the both things inside class ProductCategory_Extension extends DataExtension is it the right place

Avatar
helenclarko

Community Member, 166 Posts

23 September 2015 at 10:27am

Hi Webdoc,

You will need the following:

CustomCategory.php

private static $has_one = array(
		'caticon' => 'Image'
	);

public function updateCMSFields(FieldList $fields){
		
		//Category Image
		$fields->addFieldToTab(
			"Root.Image", 
			$uploadField = new UploadField('caticon', 'Upload an image for the category'));
			$uploadField->allowedExtensions = array('jpg', 'gif', 'png');
		
		return $fields;
	}

Then you need to add the extension to either your _config.php or config.yml files.

_Config.php

ProductCategory::add_extension('CustomCategory');

OR

config.yml

ProductCategory:
  extensions:
    - CustomCategory

-helenclarko