Showing ideas with label developer.
Show all ideas
Mag V2 is missing the magentoInfo method that is available in Mag V1 APIs. Please add this to Mag V2 REST and SOAP APIs. It is necessary for feature validation when writing third party integrations.
... View more
See more ideas labeled with:
-
API
-
developer
When i have two classes. One extending the other. class Foo {
//Some code
}
class Bar extends Foo {
//Some other code
} It's common practice to pass Bar instance to functions that requires instance of Foo. For example: magicFunction(Foo $instanceOfFoo){
....
}
$instanceOfBar = new Bar();
$result = magicFunction($instanceOfBar); But, auto-generated factory of Bar doesn't extend from Foo autogenerated factory, so you can't do this: magicFunction(FooFactory $instanceOfFooFactory){
....
}
$instanceOfBarFactory = new BarFactory(....);
$result = magicFunction($instanceOfBarFactory); I think that auto-generated factory of class, that extends some other class, should extend the other class factory as well.
... View more
See more ideas labeled with:
-
developer
From what I can see, the emails sent using the "Send this product to a friend" functionality are the only emails in which the customer can set an arbitrary "From" email address. I propose that the "From" email is a pre-configured Magento email identity, in keeping with all other usages of the email framework. This will allow 3rd party email deliverability services such as SendGrid, & Mandrill to deliver the email, as most services require correct SPF/DKIM records for sending domains. I'm sure it would have a positive effect on spam filters as well. We can set the "Reply-To" mail header to the customer's email address, to allow replies to continue as usual. I'm happy to create a pull request for this functionality, if desired.
... View more
See more ideas labeled with:
-
developer
Magento 2.1.3: I've been given the task that when a customer with a certain property registers itself it should get a different e-mail template. What this property is, is not important for the question, but lets say for sake of simplicity I have a Service Contract that can check if the customer qualifies for the different e-mail template or not: $this->customerChecker->hasCertainProperty($customerId); // returns true or false Now this might seem like an easy task right? Just hook into `Magento\Customer\Model\EmailNotification` with a plugin or something, and modify the part where the correct e-mail template is selected. Right? public function newAccount(
CustomerInterface $customer,
$type = self::NEW_ACCOUNT_EMAIL_REGISTERED,
$backUrl = '',
$storeId = 0,
$sendemailStoreId = null
) {
$types = $this->getTemplateTypes();
if (!isset($types[$type])) {
throw new LocalizedException(__('Please correct the transactional account email type.'));
}
if (!$storeId) {
$storeId = $this->getWebsiteStoreId($customer, $sendemailStoreId);
}
$store = $this->storeManager->getStore($customer->getStoreId());
$customerEmailData = $this->getFullCustomerObject($customer);
$this->sendEmailTemplate(
$customer,
$types[$type],
self::XML_PATH_REGISTER_EMAIL_IDENTITY,
['customer' => $customerEmailData, 'back_url' => $backUrl, 'store' => $store],
$storeId
);
} Right... the e-mail template is sent in this method using sendEmailTemplate(). So we can't use a interceptor for this... Well let's just look at the sendEmailTemplate()-method then: private function sendEmailTemplate(
$customer,
$template,
$sender,
$templateParams = [],
$storeId = null,
$email = null
) {
$templateId = $this->scopeConfig->getValue($template, 'store', $storeId);
if ($email === null) {
$email = $customer->getEmail();
}
$transport = $this->transportBuilder->setTemplateIdentifier($templateId)
->setTemplateOptions(['area' => 'frontend', 'store' => $storeId])
->setTemplateVars($templateParams)
->setFrom($this->scopeConfig->getValue($sender, 'store', $storeId))
->addTo($email, $this->customerViewHelper->getCustomerName($customer))
->getTransport();
$transport->sendMessage();
} Darn! The method is private! So an interceptor will definitely not work here. And we also cannot use a rewrite, since private methods are not inherited. The only way to manipulate our desired functionality is by rewriting the EmailNotification and copy/paste everything that is private from this class. Which are a lot of methods and properties. --- I would suggest that the EmailNotification-class gets some refactoring so it makes it's easier for 3rd party modules to extend it's functionality. Or am I missing something here?
... View more
See more ideas labeled with:
-
developer
-
other
I have an suggestion to include some simple sample modules (no documentation, but actual modules) that uses KnockoutJs to "Magento 2 sample module" package.
... View more
See more ideas labeled with:
-
checkout
-
developer
-
extensions
In order to display customer data on pages cached in the full page cache (Varnish or built in), the Magento framework and Magento customer module provide a number of related tools that enable this feature. Some details are outlined in the official documentation found at http://devdocs.magento.com/guides/v2.1/config-guide/cache/cache-priv-priv.html Creating such a dynamic section on a cached page requires the use of two interfaces: * Magento\Customer\CustomerData\SectionPoolInterface * Magento\Customer\CustomerData\SectionSourceInterface The interface Magento\Customer\CustomerData\SectionPoolInterface is only referenced in the configuration file etc/frontend/di.xml, but the interface Magento\Customer\CustomerData\SectionSourceInterface has to be implemented in a custom class. These interfaces currently are not marked with the @api annotation. Please add this annotation so the feature can be used in custom modules. This actually also extends to the JavaScript "classes" Magento_Customer/js/customer-data and Magento_Ui/js/lib/core/element/element (a.k.a uiElement). Please also mark these as stable so the feature can be used as described in the documentation. Thank you!
... View more
See more ideas labeled with:
-
API
-
developer
In order to display customer data on pages cached in the full page cache (Varnish or built in), the Magento framework and Magento customer module provide a number of related tools that enable this feature. Some details are outlined in the official documentation found at http://devdocs.magento.com/guides/v2.1/config-guide/cache/cache-priv-priv.html Creating such a dynamic section on a cached page requires the use of two interfaces: * Magento\Customer\CustomerData\SectionPoolInterface * Magento\Customer\CustomerData\SectionSourceInterface The interface Magento\Customer\CustomerData\SectionPoolInterface is only referenced in the configuration file etc/frontend/di.xml, but the interface Magento\Customer\CustomerData\SectionSourceInterface has to be implemented in a custom class. These interfaces currently are not marked with the @api annotation. Please add this annotation so the feature can be used in custom modules. This actually also extends to the JavaScript "classes" Magento_Customer/js/customer-data and Magento_Ui/js/lib/core/element/element (a.k.a uiElement). Please also mark these as stable so the feature can be used as described in the documentation. Thank you!
... View more
See more ideas labeled with:
-
API
-
developer
-
extensions
I really love the Magento command-line tool, however I would like to see the command line tool integrated in Linux / Mac. By doing that we could extend the native functionalities and be able to use the magento command with those new commands from any project. Problems Right now, if you want to add new commands to manage your Magento 2 installations, you have to add a new module with the code for the new commands to the project. So, if several community members contribute with different commands, the result is that you have several modules containing all those commands. For the same reason that the item above, if you create new commands to add new cool features, the code for those features should be added to every single Magento 2 project (as a result, more code in the codebase of those projects). If the command-line is included in the Magento 2 codebase (in the projects), it's very hard to extend and maintain for the reasons mentioned above. Magerun2 is the best example of how powerful and useful is a global command-line tool: https://github.com/netz98/n98-magerun2. Suggestions Since I've been contributing with the community by creating a command-line tool for Mac (https://github.com/guarinogabriel/Mac-CLI), I have a couple of suggestions to improve the Magento 2 command-line tool: Release it as the Magento command-line tool in Github: It could be a separate project in Github, so the community can focus on contributing specific features/improvements to the CLI. Make it global: The Magento installer could install the tool in the /usr/local/bin/ folder to make the command-line tool global in the system. Auto-complete features: The perfect example of this is the SAWS command line tool (https://github.com/donnemartin/saws): Magento 2 could use the global magento command-line tool: One of the goals of the Magento 2 command-line tool is to replace the shell scripts from Magento 1 and use commands in Magento 2 instead. Those commands could be appended to the global command line tool. So, if you run the magento command from the project folder, the commands from that project will be appended to the global commands. I'd love contributing with this idea by creating a pull request and start working on the global command-line tool if the Magento team and the community like it.
... View more
See more ideas labeled with:
-
developer
-
other
In some custom modules the IP address of the current visitor is required (e.g. for GeoIp lookups or access control). The class \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress provides this feature, however it is not marked as stable. In order to be able to use the class within third party modules, it would be nice to have a method that is blessed with the @api annotation.
... View more
See more ideas labeled with:
-
API
-
developer