2004 Posts in 533 Topics by 435 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Working on e-commerce for SS 2.4
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 10356 Views |
-
Re: Working on e-commerce for SS 2.4

11 June 2010 at 1:30am
hi jeda one question. I'm trying to extend the product page, in a way similar to the one showed in tutorial 2 (when it's extending page). The table is correctly cerated, the php file is placed in mysite folder, but on the cms it's not working, calling it a product page in the create dropdown, and not showing any of the fields I added (for now, Checkboxfield and textfield)... any suggestions? It would be source of problems doing that?
<?php
class Agenda extends Product {
static $db = array(
'Ricambiabile' => 'Boolean',
'NumeroFogli' => 'Int'
);function getCMSFields() {
$fields = parent::getCMSFields();$fields->addFieldToTab('Root.Content.Main', new CheckboxField('Ricambiabile'), _t('Agenda.RICAMBIABILE', 'Carta Ricambiabile'));
$fields->addFieldToTab('Root.Content.Main', new TextField ('NumeroFogli', _t('Agenda.NUMEROFOGLI', 'Product Code'), '', 4),'Content');return $fields;
}.
}
?> -
Re: Working on e-commerce for SS 2.4

11 June 2010 at 2:48am
Hi mattconfusion,
after update a class, you must launch /dev/build?flush=1
PS: could you contact me on my mail ( see my profile )?
-
Re: Working on e-commerce for SS 2.4

11 June 2010 at 3:02am
done it, but seems to be not working.
i will contact you but right now i'm gonna leave so it would be tomorrow morning, sorry pal. -
Re: Working on e-commerce for SS 2.4

11 June 2010 at 3:43am
Hi,
Example:
class News extends Page {public static $db = array(
'DataNews' => 'Date'
);static $has_one = array(
'NewsBanner1' => 'News_Image',);
/**
* Create the fields within the CMS
*/
function getCMSFields() {
$fields = parent::getCMSFields();$fields->addFieldToTab("Root.Content.Main", new CalendarDateField("DataNews", "Data"));
$fields->addFieldToTab("Root.Content.Images", new ImageField("NewsBanner1", "Immagine News"));
return $fields;}
}
I see, in you code "}." Is dot a mistake? You must del it.
PS: Matt, I'm italian like you. On my site , you find my contacs ( MSN too ). -
Re: Working on e-commerce for SS 2.4

11 June 2010 at 7:10pm Last edited: 11 June 2010 7:10pm
actually your code is running, but it's my approach it's incorrect. I'm basically trying to have more customized types of products. a simple extension like the one we have been talking about since now, gives you
[User Warning] ModelAsController::getNestedController() returned bad object type 'ACertainProduct'
(where a certain product is obiviosly the product extension) .
What would be the correct approach to extend the Product Object to make it still recognizable as a product with additional features? In addition to this, an extension like the one posted above gives you, in the dropdown menu of ?create Page'the Product title again. So even if you extended it, it still appears as another Product type page
@biapar: yeah I know you're italian ; ) don't have msn in this place but if you want i made visible my email address too
-
Re: Working on e-commerce for SS 2.4

11 June 2010 at 8:09pm
Hi,
the approach of extend "class Agenda extends Product" is ok.
Have you that error because you made agenda child of agenda?
| 10356 Views | ||
| Go to Top | Next > |

