texts: Append custom shipping address attribute to API V2 wsdl result

texts:
I added the Dhl Account module in my magento 1.9.2.4 installation to get the possibility to ship to a dhl packing station. The module appends a field called dhlaccount to the shipping address of an order.

Now I have the problem that this field does not exist in the salesOrderInfo API request. Is there a way to append a custom shipping address field to the API result?

Thanks in advance!

Install script

/* @var $installer Mage_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();

/* @var $addressHelper Mage_Customer_Helper_Address */
$addressHelper = Mage::helper('customer/address');

// update customer address user defined attributes data
$attributes = array(
    'dhlaccount' => array(
        'backend_type'    => 'varchar',
        'backend_model'   => '',
        'backend_table'   => '',
        'frontend_model'  => '',
        'frontend_input'  => 'text',
        'frontend_label'  => 'DHL Account',
        'frontend_class'  => '',
        'source_model'    => '',
        'default_value'   => '',
        'is_user_defined' => 1,
        'is_system'       => 0,
        'is_visible'      => 1,
        'sort_order'      => 140,
        'is_required'     => 0,
        'multiline_count' => 0,
        'validate_rules'  => array(
            'max_text_length' => 10,
            'min_text_length' => 6
        ),
    ),

);

/* @var $eavConfig Mage_Eav_Model_Config */
$eavConfig = Mage::getSingleton('eav/config');
foreach ($attributes as $attributeCode => $data) {
    $attribute = $eavConfig->getAttribute('customer_address', $attributeCode);
    $attribute->addData($data);
    $usedInForms = array(
        'adminhtml_customer_address',
        'customer_address_edit',
        'customer_register_address'
    );
    $attribute->setData('used_in_forms', $usedInForms);
    $attribute->save();
}

$installer->run("
    ALTER TABLE {$this->getTable('sales_flat_quote_address')} ADD COLUMN `dhlaccount` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL AFTER `fax`;
    ALTER TABLE {$this->getTable('sales_flat_order_address')} ADD COLUMN `dhlaccount` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL AFTER `fax`;
");
$installer->endSetup();


texts:
I have set up three websites and allocated different base currencies.
However, it it not appearing correctly on the frontend.

Also on the catalog page of admin, I cannot input in different base currencies.
What could be the reason?


texts: We have been duplicating products in Magento in order to have the categories etc assigned, and then typing in new information title etc, deleting out the URL key so it saves a new one with the new product, but when we look at the product on our website is have been given the URL of the product prior to duplication and a number, why is magento not creating a new URL automatically? Plus I have then gone into the product, and a URL has not been saved I have then entered the correct URL and Magento has still not changed the URL? Someone please help!!


texts: How to make a landing page that "links" to different store views

texts:
I am relatively new to magento. I am trying to create a landing page that will have image links to the two different store views. I used this tip to set that up.
How to setup multi stores with different themes for Magento CE

But there's a few problems.

I don't know if my approach is correct. I set up the stores and store views in magento, and then I created cms pages for each store and set them to the store view. Then, I created a cms landing page which I set to the default "home page", added the images and inserted the URL links. When the images are clicked it goes to the "page not found." I tried setting the store view for both pages to "all store views" and then the image links worked. But I don't know if this disconnects the page from the store and it's catalogue. Here's the homepage so you can see what I mean. http://tuckersfurniture.biz

2.I have set up theme variations for both the store views but I can't get them to show up. The file structure looks like this:

-app-design-frontend-hellowiredx-default
-app-design-frontend-hellowiredx-cashcarry
-app-design-frontend-hellowiredx-valleyfurniture

-skin-frontend-hellowiredx-default
-skin-frontend-hellowiredx-cashcarry
-skin-frontend-hellowiredx-valleyfurniture

The only difference between these are things like background color and logo. As far as I can tell, I have put the right names in the right fields in magento to call the different theme variants, so I don't think that is the problem. I think I somehow set up the pages or the stores wrong or the store is not properly linked to its respective page.

Like I said I'm relatively new at this so I appreciate any help I can get. I don't know much about PHP, so if that is part of the solution you might have to walk me through it.


texts:
I am trying to get an API for banners in home page to list in my mobile app. Is there is a module for that?

Ex:

https://{{magento-host}}/index.php/rest/V1/banners


texts: What's the standard way to load the source model of product attributes, with respect to the default source model?

texts:
I have a product attribute with type "select", for example "manufacturer". No source model is defined, so Magento uses the default source model, defined in Mage_Eav_Model_Entity:

const DEFAULT_SOURCE_MODEL      = 'eav/entity_attribute_source_config';

But with this code:

$manufacturerAttribute = Mage::getModel('catalog/entity_attribute')
    ->loadByCode(Mage_Catalog_Model_Product::ENTITY, 'manufacturer');
$values = $manufacturerAttribute->getSource()->getAllOptions();

I get this exception:

  Source model "" not found for attribute "manufacturer"

Tracing down the error, I found that the default source model is actually fetched in Mage_Eav_Model_Entity_Attribute_Abstract with:

protected function _getDefaultSourceModel()
{
    return $this->getEntity()->getDefaultAttributeSourceModel();
}

and:

/**
 * Retrieve entity instance
 *
 * @return Mage_Eav_Model_Entity_Abstract
 */
public function getEntity()
{
    if (!$this->_entity) {
        $this->_entity = $this->getEntityType();
    }
    return $this->_entity;
}

This looks all fine in the IDE but when I debug, I notice that getEntity actually returns an object of Mage_Eav_Model_Entity_Type which does not have a getDefaultAttributeSourceModel() method, unlike Mage_Eav_Model_Entity_Abstract. Looks like a bug in Magento to me...

What makes it even more confusing, is that _getDefaultSourceModel() is overridden in Mage_Catalog_Model_Resource_Eav_Attribute:

/**
 * Get default attribute source model
 *
 * @return string
 */
public function _getDefaultSourceModel()
{
    return 'eav/entity_attribute_source_table';
}

But since $attribute->getResource() always gives me an instance of Mage_Eav_Model_Entity_Attribute, I don't know how to make use of this.

I know that I could define the source model explicitly in an update script and that's how I usually handle it, but there has to be a proper way to make use of the default source model, I just can't figure it out.


texts: Magento 2 product image gallery not responsive/resizing

texts:
I've made a custom Magento 2 Theme, updated the view.xml with all my image dimensions, and resized the catalog images through the cli.

However, the Fotorama image gallery on product pages is not resizing, it isnt displaying the right image size and when I resize the browser window < 768px the image width and height both become 2px.

Does anyone know what my problem might be?


texts: What Is The Best Practice To Validate a Property of a Controller In an In another Controller Validation

texts:
Let me explain a demo situation.

I need to allow only logged in customers to subscribe newsletter. So in newsletter controller, I am validating whether the user is guest or a valid customer. If the user is guest, I am redirecting the user to log-in page.

Now suppose user is logging into his account. In that case, during the success login, I need to automatically make newsletter subscription for that user. In order to do this operation, I need to get subscription details during the validation action takes place.

What is the best way to do this ?

These are my ideas.

1) Make a global object that holds newsletter details (using Mage::register())

2) Create a session that holds newsletter for future validation.

3) send newsletter details via url to login page and then use those data there

Note: I will most probably use an observer for validation. So I need to varify newsletter status over there :)

Thanks in advance for any kind of suggestion


texts: Add inline JavaScript to the head of Magento 2.1

texts:
I'm trying to add BugHerd (an issue tracking tool) to my Magento 2.1 project, which requires I add the following script into the <head> tag:

<script type='text/javascript'>
  (function (d, t) {
     var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
     bh.type = 'text/javascript';
     bh.src = 'https://www.bugherd.com/sidebarv2.js?apikey={my api key}';
      s.parentNode.insertBefore(bh, s);
  })(document, 'script');
</script>

There are many questions on this topic referencing old Magento versions, but I can't seem to find an updated answer. Any ideas?

Thanks!


texts: how to sort order of custom blocks in sidebar in magento2

texts:
I have used following code to insert custom blocks in sidebar.

but those are coming in the last of sidebar.i want first custom block-1 then layered navigation then custom block-2 etc.

   <?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <body>
       <referenceContainer name="sidebar.additional">
           <block class="Magento\Cms\Block\Block" name="useourfinder" before="-">
               <arguments>
                    <argument name="block_id" xsi:type="string">useourfinder</argument>
               </arguments>
           </block>
        </referenceContainer>        <referenceContainer name="sidebar.additional">
           <block class="Magento\Cms\Block\Block" name="sandiego">
               <arguments>
                    <argument name="block_id" xsi:type="string">sandiego</argument>
               </arguments>
           </block>
        </referenceContainer>
   </body>
</page>


texts:
I'm trying to output a description below each UPS method that appears on the list of available methods but can't seem to do it without the UPS module bugging out!

Currently in my alternative shipping extension I've defined a description and I'm outputting it into available.phtml as echo $_rate->getMethodDescription()

How would I go about defining a description for each UPS method in the default module? Ultimately I want to basically tell people the timescale based on the destination country they've entered.

TIA


texts: In what location should I install the composer

texts:
I have Linux server and my magento folder is located in:

/home/b2b/domains/mydomains.com/public_html/<magento here>

I have found how to install composer:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

But where I should run above command ? In root server folder after open putty or first go to magento folder:

cd /home/b2b/domains/mydomains.com/public_html/

and then run ?


texts: Update a custom field value of cutomer_address table into sales_flat_order_address table

texts:
I have a custom field(new_address_code) for customer address in backend. A observer is used to assign a auto-generated value to the field when ever a new address is added through myaddress or in checkout page

<customer_address_save_after>
      <observers>
         <myautoincrement>
            <class>samp/observer</class>
            <method>saveadrsmethod</method>
         </myautoincrement>
      </observers>
</customer_address_save_after>

In the observer class

$customerAddress = $observer->getCustomerAddress();
$id= (string)$customerAddress->getId();
$ObcustomerAddress = $observer->getCustomerAddress();
if ($customerAddress->getId()) {
            $customerAddress->setData('new_address_code','aftertesting-'.$customerAddress->getData('firstname').'=myid'.$id);
             $customerAddress->getResource()->saveAttribute($ObcustomerAddress, 'new_address_code');
   }

Whats the problem here is when a new address is added while checkout, the auto-generated custom fields value is not saved into sales_flat_quote_address table. So, I tried writing an observer for that as follows

<sales_order_place_before>
    <observers>
       <myautoincrement>
          <class>samp/observer</class>
          <method>beforeorder</method>
       </myautoincrement>
    </observers>
</sales_order_place_before>

And in the  observer class

public function beforeorder($observer)
{
    $order = $observer->getEvent()->getOrder();
    $customerAddress = $observer->getCustomerAddress();
    if ($customerAddress->getId()) {
        $address=Mage::getModel('sales/order_address')->setData('new_address_code',$customerAddress->getData('new_address_code'));
        $order->setBillingAddress($address);
        $order->setShippingAddress($address);
    }
}

But it's not saving in the sales_flat_order_address table. Could anybody tell me what could be the reason.


texts:
I've read Magento upgrade instructions that describe setting up the new version, then moving the customization from the old version to the new install (oversimplification).

I was wondering if people could recommend a process for possibly accelerating/automating through git merges migrating from old to new?  Is that practical?  Or, is this going to be mostly a manual process.


texts: How to change meta tag "twitter:description" for home page in Magento 2

texts:
I want to add/edit meta tag keyword and descriptions as per my need.

Currently meta tag "twitter:description" is showing short description but I want to add some other content as per my conditions, so please share my path where I can edit these meta tags.

Also, I want to add meta tag "og:image" and URL will be dynamic.


texts:
I need to set up 2 stock level, one per customer group (one for custom and one for wholesale) can someone point me to the right direction plz?
Thanks


texts: How can overwrite an event from JS file in custom theme or module without overwriting the whole file?

texts:
How can overwrite an event from sidebar.js in my custom theme or custom module without effecting anything else that is located in the file? What is the best approach? I need to make the following change:
The file and event that I need to overwrite:
vendor/magento/module-checkout/view/frontend/web/js/sidebar.js

Change from:
         /**
         * @param {jQuery.Event} event
         */
        events['click ' + this.options.button.remove] =  function (event) {
            event.stopPropagation();
            confirm({
                content: self.options.confirmMessage,
                actions: {

                /** @inheritdoc */
                confirm: function () {
                    self._removeItem($(event.currentTarget));
                },

                /** @inheritdoc */
                always: function (e) {
                    e.stopImmediatePropagation();
                }
            }
        });
    };

To:
     /**
     * @param {jQuery.Event} event
     */
    events['click ' + this.options.button.remove] =  function (event) {
        event.stopPropagation();
        self._removeItem($(event.currentTarget));
    };

I just want to change this single element. Can you advise on the best approach here?


texts: How to generate shipping number and print labels for Fedex in Magento 1.9?

texts:
I am using Fedex shipping in Magento. I have created a developer account on Fedex developer section and get Account ID, Test Key, Password etc and added these in Magento Admin section for Fedex shipping method.
After this what i need to do? I have searched for documentation but didn't find any documentation for next steps like how to generate shipping tracking number and how to print shipping labels?


texts: Magento 2 - How to conditionally show/hide the minicart block based on the customer permissions

texts:
The problem:

I'm running into an issue with the page/block caching and the minicart.
In the template cart/minicart.phtml we have a permission check to see if the current customer is allowed to add products to the cart like so:

<?php if ($customerViewModel->hasPermission(PermissionManagerInterface::ACL_RESOURCE_4)): ?>
    // Render the minicart
<?php endif; ?>

The problem here is that this block is being cached on the first visit. So if the first customer who visits the page is allowed to add products to the cart then customers who don't and logged out visitors will see the cart button in the header.

Fix attempt 1: Override the block and set _isScopePrivate to true

While this fixed the initial issue with the always-visible (or never visible) cart button, a new issue came up: the contents of the cart is never rendered, presumably because the mage-init/knockoutJS stuff is now not executed properly. The dialog which should contain the items is always an empty white box.

Fix attempt 2: Setting cacheable to false

Aside from getting the issue of the full_page cache now never picking up the pages, this did not do anything to the block output. It's still either always visible or never visible.

The current workaround

Currently, I have disabled the block_html cache and this "fixes" all the issues above. But I would prefer if there is a way to make the block just appear conditionally based on the output of the hasPermission check.

TL;DR

Is there a way to conditionally show/hide the minicart block based on the output of a hasPermission method.


texts: Checkout Payment gateway not working with onestepcheckout in magento 1

texts:
Checkout payment method module is working with default one-page checkout but when I am trying to use it with magestore Onestepcheckout, it's not working.

Anyone have an idea about that.


texts: How to create custom extension on Magento 2, or module or plugin

texts:
There are many tutorials available when people start to say: "Here is how to create custom Magento 2 extension". And then they start to describe how to create module, instead of the extension. So i was confused, is it the same or there is the difference between module and extension? Then, later on, someone also mentioned plugins. Now I'm really confused, because we have 3 different types of additions/enhancers of Magento 2 functionality: extensions, modules, plugins.

The question is, if this all 3 not the same:

Then what the technical differences between them?
What is possible to accomplish with one of them that not possible with another one. Or what are limitations of all 3 of them by what is possible to do?
How installation process differs between those 3 types?

I need to clearly understand this, because I need to decide which one is the best fit for my needs to be selected. Plus would be nice to have links to the tutorials, if they are not the same, to all 3 of them separately.

Thanks for the help.


texts: Magento 2 : How to Return the Collection from afterload

texts:
I have implemented this jquerytokenizer in Ui Component form shown in the below image.

It works well , the data is saved accurately- but when I go to edit a saved record this field is empty without the saved tags.

  To serve the purpose I fetched the tags in afterload

    namespace Vendor\Module\Model\ResourceModel;

    use Magento\Framework\DB\Select;
    use Magento\Framework\Exception\LocalizedException;
    use Magento\Framework\Model\AbstractModel;
    use Magento\Framework\EntityManager\MetadataPool;
    use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
    use Magento\Framework\Model\ResourceModel\Db\Context;
    use Magento\Store\Model\Store;
    use Magento\Store\Model\StoreManagerInterface;
    use Magento\Framework\EntityManager\EntityManager;

    class Article extends AbstractDb
    {

    protected $_store = null;

    protected $_storeManager;

    protected $entityManager;

    protected $metadataPool;

    public function __construct(
        Context $context,
        StoreManagerInterface $storeManager,
        EntityManager $entityManager,
        MetadataPool $metadataPool,
        $connectionName = null
    ) {
        parent::__construct($context, $connectionName);
        $this->_storeManager = $storeManager;
        $this->entityManager = $entityManager;
        $this->metadataPool = $metadataPool;
    }

    /**
     * Initialize resource model
     *
     * @return void
     */
    protected function _construct()
    {
        $this->_init('vendor_module', 'articles_id');
    }

    protected function _afterLoad(AbstractModel $product)
    {
        $articleId = $product->getId();
        $connection = $this->getConnection();
             $select = $connection->select()->from(['tag_table_name' => 'tag_table_name'])
                 ->where('tag_table_name.' . 'articles_id' . ' IN (?)', $articleId);
             $result = $connection->fetchAll($select);
             //print_r($result);exit;

        return parent::_afterLoad($product);
    }
}

  When I echo $result the result is

  Array
(
[0] => Array
    (
        [id] => 7
        [articles_id] => 33
        [tag_names] => asdfasdf
    )

[1] => Array
    (
        [id] => 8
        [articles_id] => 33
        [tag_names] => adfasdfsad
    )

[2] => Array
    (
        [id] => 9
        [articles_id] => 33
        [tag_names] => fsdafdsafsdaf
    )

   )

  My Ui Component form field is :

<field name="tag_names">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="component" xsi:type="string">Vendor_Module/js/tags</item>

                <item name="template" xsi:type="string">ui/form/field</item>

                <item name="elementTmpl" xsi:type="string">Vendor_Module/form/element/tags</item>
                <item name="label" xsi:type="string">Article Tags</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">article</item>
            </item>
        </argument>

  And the custom filed html is :

<select multiple class="admin__control-multiselect" data-bind="
attr: {
    name: inputName,
    id: uid,

    disabled: disabled,
    'aria-describedby': noticeId,
    placeholder: placeholder
},
hasFocus: focused,

selectedOptions: value,
optionsValue: 'label',
optionsText: 'label',
modtaggee: true"
/>

Can any one figure out where I am going wrong or propose a solution. Thanks in Advance.


texts: Magento (ver. 1.7 / 1.8.1.0) built in Captcha on Front-end Custom Form

texts:
I am trying to add Magento (ver. 1.8.1.0) in-built Captcha on extension 'Ask A Question' but somehow it's not displaying on the front-end page tab:

(1) app/code/community/Unirgy/DropshipVendorAskQuestion/etc/config.xml

<default>
 <captcha>
     <frontend>
         <areas>
             <dcg_module_unique>
                 Ask A Question
             </dcg_module_unique>
         </areas>
     </frontend>
 </captcha>
 </default>

<events>
    <controller_action_predispatch_customer_post>
        <observers>
            <udqa>
                <class>udqa/observer</class>
                <method>checkCaptcha</method>
            </udqa>
        </observers>
    </controller_action_predispatch_customer_post>
    </events>

(2) app/code/community/Unirgy/DropshipVendorAskQuestion/Model/Observer.php

public function checkCaptcha($observer) {

    $formId = 'dcg_module_unique'; // Identifier in config.xml
    $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
    $request = $controller->getRequest();
    if ($captchaModel->isRequired()) {
        $controller = $observer->getControllerAction();

        $request->getPost(Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE);
        if (!$captchaModel->isCorrect($this->_getCaptchaString($request, $formId))) {

            if((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) {
                // Is ajax
                $action = $request->getActionName();
                Mage::app()->getFrontController()->getAction()->setFlag(
                        $action, Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);

                $controller->getResponse()->setHttpResponseCode(200);
                $controller->getResponse()->setHeader('Content-type', 'application/json');

                $controller->getResponse()->setBody(json_encode(
                        array(
                            "msg" => Mage::helper('module')->__('Incorrect CAPTCHA.')
                        )
                    ));

            } else {
               // Is form submit
                Mage::getSingleton('customer/session')
                    ->addError(Mage::helper('module')->__('Incorrect CAPTCHA.'));
                $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
                Mage::getSingleton('customer/session')
                    ->setCustomerFormData($controller->getRequest()->getPost());
                $controller->getResponse()->setRedirect(Mage::getUrl('*/*'));
            }
        }
    }
  return $this;
}

(3) app/design/frontend/base/default/template/uqda/product/question.phtml

    Captcha :
    <?php echo $this->getLayout()->createBlock('captcha/captcha')
        ->setFormId('dcg_module_unique')
        ->setImgWidht(230)
        ->setImgHeight(50)
        ->toHtml();
    ?>

(4) app/design/frontend/base/default/template/uqda/product/tab.phtml

<?php

echo $this->getChildHtml('udqa.list');
echo $this->getChildHtml('udqa.qa');
echo $this->getChildHtml('captcha');

?>

I have followed this tutorial:
(1) http://mustakarhu.com/blog/magento-captcha-extension-ajax/

Any clues? Thanks in advance.


texts: DI compile step keeps failing after upgrading from 2.3.3 to 2.3.5 via composer. [Magento 2 EE]

texts:
The error is the same every time I've tried, which is:

PHP Fatal error:  Declaration of Magento\PageBuilder\Model\Dom\NodeList::item($index) : ?Magento\PageBuilder\Model\Dom\Adapter\ElementInterface must be compatible with Magento\PageBuilder\Model\Dom\Adapter\NodeListInterface::item(int $index): ?Magento\PageBuilder\Model\Dom\Adapter\ElementInterface in vendor/magento/module-page-builder/Model/Dom/NodeList.php on line 19


texts: Display admin configuration field by other field text value

texts:
In Magento2 admin configuration we can display field conditionally like below,
<field id="do_3Dsecure" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    Activate 3DS Authentication
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>

<field id="enable_dynamic3DS2" translate="label" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
                    Enable 3DS2 Authentication
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <depends><field id="do_3Dsecure">1</field></depends>
</field>

It is Yes/No (1/0) and it is working fine with depends node. But in my case that dependant field is having text value, like below
 <field id="integration_mode" translate="label" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
                    Integration Mode
                    <source_model>Mymodule\Test\Worldpay\Model\Config\Source\IntegrationMode</source_model>
                </field>

it is a dropdown field and it contains below below values

direct
redirect

So, is there any possible to display field based on this above text value by using depends node ?


texts:
As I researched everywhere all the developers prefer LAMP for Magento framework. What if we use WAMP? or is there any specific reason to use LAMP?
If the answer is yes, please state some benefits/ advantages in Magento with LAMP.


texts: Magento 1 - How to update from 1.9.4.4 to 1.9.4.5

texts:
I'm very new to Magento 1 and I need to update from 1.9.4.4 to 1.9.4.5 on my staging system.
How can I do that? I can't use composer or anything else.
Thanks in Advance!


texts: Magento 2: How to view/implement Magento icons from 'icons-blank-theme' font-family

texts:
I am currently developing a custom theme using Magento 2.3.

I am altering the sidebar menu, so that its top-level items are collapsible and an arrow appears beside them when clicked, the same as the top menu. The difference here is that, when the menu item is active and its children are visible, the arrow should point down. When it is not visible, the arrow should point left.

I have used grep, find and locate to attempt to find something which relates to icons but I haven't been able to actually locate the set of icons that Magento uses here, so I'm not sure which code I should enter as a value in the content: field in order to display the left arrow.

I can see that the following style rules are applied to achieve the downwards-pointing arrows on the top-menu:

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 12px;
  line-height: 20px;
  color: inherit;
  content: '\e622';
  font-family: 'icons-blank-theme';
  vertical-align: middle;
  display: inline-block;
  font-weight: normal;
  overflow: hidden;
  speak: none;
  text-align: center;

I have applied this styling to all sidebar items which have my active class and it works. I just need to know where the file containing icons-blank-theme resides.

EDIT:

I have found a very long-winded workaround. The level1+ items within the topmenu use a right-facing arrow. I double-checked that the codes for the right- and downwards-facing arrows were both relatively close to each other (\e608 and \e622). I then altered the CSS value on the webpage using my browser's code inspector feature and manually searched e608-22 until I discovered the code for the left-facing arrow \e617. To clarify, I do not require the code, I simply require directions explaining how to determine which icons are available and which codes belong to them.


texts:
We have multistore setup environment in our application, and we enabled onepage checkout.
    On French site
    If customer is registered in the onepage checkout,customer registration confirmation email is going in English, it supposed to go in French, but Order confirmation is going in French.


texts: How to show customer first name and last name after logged in Magento2.2.5?

texts:
I want to show customer first name and last name after logged in Magento2.2.5?
As default magento fetches the first name and last name after logged in.

In my case, I have removed magento default first name and last name and added custom first name and last name for some customization purpose.

After adding my custom fields, the first name and last name is not shown in header after customer logged in Magento2.2.5?

Please someone guide me on this.

Any help would be appreciated.

Thanks in advance.


texts: Why Getting categories and names on product view page Magento 2 fails?

texts:
I am using the getCategories() function below:

use Magento\Catalog\Block\Product\AbstractProduct;
use Magento\Catalog\Block\Product\Context;

class Categories extends AbstractProduct
{

    private $logger;

    public function __construct(Context $context,
                                \Psr\Log\LoggerInterface $logger,
                                array $data = [])
    {
        $this->logger = $logger;
        parent::__construct($context, $data);
    }

    public function getCategories()
    {
        $product = $this->getProduct();
        $cats = $product->getCategoryCollection()
            ->addAttributeToSelect("name")
            ->addIsActiveFilter();
        return $cats;
    }
}

The layout file catalog_product_view.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="product.info.main">
            <block class="Company\ProductCategories\Block\Product\View\Categories"
                   name="product.view.categories"
                   template="Company_ProductCategories::product/view/categories.phtml"
                   before="product.social.links">
            </block>
        </referenceContainer>

</page>

And the template file categories.phtml:

<?php
    /** @var \Magento\Catalog\Model\Category $categories */
    $categories = $this->getCategories();
?>

<?php if ($categories->getSize() > 0): ?>

Categories:
    <?php foreach($categories as $category): ?>
        <a href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?>
    <?php endforeach; ?>

<?php endif; ?>

So this returns the category names when going to a product from a category page.

However when I go to a product view from the front page through a new or latest products block, it does not add the category names to the results.
It also doesn't add the proper path of breadcrumbs.

Just a bit more info the url when navigating from the catalog page:

http://shop.dev/ammunition/airgun/exact-airgun-pellets-44gr-500.html

Where ammunition and airgun are the categories.

when going from the home page the url is just:

http://shop.dev/exact-airgun-pellets-44gr-500.html

I tested this on a standard magento install and whether going to the page from a catalog page or the home page the url is the same: http://magento2.dev/index.php/hero-hoodie.html and the categories show.

Why is that on this porto theme, there is an issue?


texts: Magento 2: Create new customer attribute in module upgrade

texts:
I want to add new customer attribute 'business_type' which would be a selectbox.

I want to do it in already created module, so I would need module update script.

Can anyone help me on this as I am new to Magento2.


texts: Error 400 Bad Request and 500 Internal Server Error

texts:
I tried to remove item in the cart, but nothing happen and error message at inspect element appear POST http://xxx.xxxxxxxx.com/checkout/sidebar/removeItem/ 500 (Internal Server Error), but before that, when the page loaded, there's error like in below.

Element :

GET http://xxx.xxxxxxxxx.com/customer/section/load/?sections=cart-data&update_section_id=false&_=1509091047933 400 (Bad Request)

Response :

{"message":"&quot;cart-data&quot; section source is not supported"}

Is there any error when magento getting the customer data?


texts: Uploaded images not appearing on frontend and backend with a Broken image symbol

texts:
I have uploaded images to products. It has been viewed then in backend and frontend it is not appearing.

I have checked with stackoverflow answers like
Products do not show up in front end

and checked. everything is perfect.

But Now it is showing Broken Image symbol in backend and Magento no image at front end.

If I upload new image to the product page, it is showing the new picture to that product, but old uploaded images remain as a broken image.

Please help to fix it. I have more than 1000 products on site.


texts: where can i find magento ajax image loading gif?

texts: Where can I find magento ajax image loading gif? How can I replace the default existing magento ajax loading gif?


texts: Review form to appear after On-click on a button

texts:
On the product page, I want to create a button on the product page which will trigger review form to appear. Currently, I am having just form on the page. And submit button of this form. So where to change it?

EDIT  till now I have disappeared the form from the page using this in custom.less file.

form#review-form {
    display: none;
}

So now I want to create a button and give it a javascript like onClick to display block


texts:
Unable to Unserialize value error after upgrading Magento to 2.2.2

For this i have followed the solution from here:
Magento 2.2: Unable to unserialize value? by @Sameer Bhayani
and overrided the Json file of Magento\Framework\Serialize\Serializer\Json

But after that i was getting the below error:

Exception #0 (Exception): Warning: array_merge(): Argument #2 is not an array in /home/xxxxxxxxxxxxx/public_html/vendor/magento/module-catalog/Helper/Product/Configuration.php on line 118

Please Advise.


texts:
I'm getting the error with the layered navigation and custom attributes:

You cannot define a correlation name 'color_idx' more than once

Trace:
#0 E:\WWW\capolavoro.com.br\loja\lib\Varien\Db\Select.php(281): Zend_Db_Select->_join('inner join', Array, 'cor_idx.entity_...', Array, NULL)
#1 E:\WWW\capolavoro.com.br\loja\lib\Zend\Db\Select.php(336): Varien_Db_Select->_join('inner join', Array, 'cor_idx.entity_...', Array, NULL)
#2 E:\WWW\capolavoro.com.br\loja\lib\Zend\Db\Select.php(315): Zend_Db_Select->joinInner(Array, 'cor_idx.entity_...', Array, NULL)
#3 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Catalog\Model\Resource\Layer\Filter\Attribute.php(70): Zend_Db_Select->join(Array, 'cor_idx.entity_...', Array)
#4 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Catalog\Model\Layer\Filter\Attribute.php(94): Mage_Catalog_Model_Resource_Layer_Filter_Attribute->applyFilterToCollection(Object(Mage_Catalog_Model_Layer_Filter_Attribute), '12')
#5 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Catalog\Block\Layer\Filter\Abstract.php(91): Mage_Catalog_Model_Layer_Filter_Attribute->apply(Object(Mage_Core_Controller_Request_Http), Object(Mage_Catalog_Block_Layer_Filter_Attribute))
#6 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Catalog\Block\Layer\Filter\Abstract.php(73): Mage_Catalog_Block_Layer_Filter_Abstract->_initFilter()
#7 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Catalog\Block\Layer\View.php(136): Mage_Catalog_Block_Layer_Filter_Abstract->init()
#8 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Block\Abstract.php(293): Mage_Catalog_Block_Layer_View->_prepareLayout()
#9 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Model\Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#10 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Model\Layout.php(472): Mage_Core_Model_Layout->createBlock('catalog/layer_v...', 'catalog.leftnav')
#11 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Model\Layout.php(239): Mage_Core_Model_Layout->addBlock('catalog/layer_v...', 'catalog.leftnav')
#12 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Model\Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#13 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Model\Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#14 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Controller\Varien\Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#15 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Catalog\controllers\CategoryController.php(148): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#16 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Catalog_CategoryController->viewAction()
#17 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#18 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 E:\WWW\capolavoro.com.br\loja\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 E:\WWW\capolavoro.com.br\loja\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#21 e:\WWW\capolavoro.com.br\loja\index.php(87): Mage::run('', 'store')
#22 {main}

Searching in the internet, probably blocks are duplicated but in my catalago.xml is ok.


texts: Magento 2 - Refill cart after refused from payment page

texts:
I want cart to be refilled after customer return back to my controller with some error. Here is my controller code, I can access increment_id here

public function execute()
{
    if(array_key_exists("req_reference_number",$_POST)) {
        $increment_id = $_POST["req_reference_number"];
        $status = $_POST["decision"];
        $message = $_POST["message"];
        $order = $this->order->loadByIncrementId($increment_id);
        if ($status == "CANCEL") {
            //Cancel previous order
            $this->statusCanceled($order);

            /*************
            ** Want to refill cart here
            **************/

            //redirect to checkout page with restoring cart
            $redirectionUrl = $this->url->getUrl('checkout/cart/');
            $this->response->create()->setRedirect($redirectionUrl)->sendResponse();
        }
    }else{
        $redirectionUrl = $this->url->getUrl('/');
        $this->response->create()->setRedirect($redirectionUrl)->sendResponse();
    }
    die();
}

My question is, how can I refill my cart using order increment id that is placed and cancelled.

I had used this code but it's not working, my cart is still empty

$quote = $this->quoteRepository->get($order->getQuoteId());
$quote->setIsActive(1)->setReservedOrderId(null);
$this->quoteRepository->save($quote);
$this->session->replaceQuote($quote);


texts:
I'm trying, for various reasons, to use an "external" (as in non-Magento) frontend. I do want to keep the checkout process (because I want the order/shipping/invoicing functionality) in Magento, so I obviously must keep the Cart in Magento as well. However, I can not get the "other" frontend to share the Cart with my Magento installation.
The custom frontend is:

Integrated by simply including the Mage.php file (heavily inspired by Magento-on-Angular) and using it's method for adding items to cart
On the same domain (for now, localhost or 127.0.0.1)
Working fine in isolation in both "systems" (i.e add-to-cart is actually adding to the cart in the same frontend, but not shared).
Not given the same output from Mage::getSingleton("core/session")->getEncryptedSessionId()
Given the same output from \Mage::app()->getWebsite()->getId()
Not given the same output from Mage::getSingleton('checkout/session')->getQuote()->getId()
Using Laravel as framework

I do realize that a possible workaround would be to somehow force the getQuote()->getId() in the real Magento when passing cutomer to checkout. This does feel dirty though, and will probably cause lots of lost Carts (that's just a not educated guess though).
Actual code (stripped down and combined from several methods)
Custom Frontend - add to cart
session_start();
\Mage::getSingleton('customer/session')->start();
$product = \Mage::getModel('catalog/product')->load((int) $productId);

$basket = \Mage::getSingleton('checkout/cart');
$basket->addProduct($product, 1);
$basket->save();

Custom Frontend - show cart sub total
session_start();
\Mage::getSingleton('customer/session')->start();
$session    = \Mage::getSingleton('checkout/session');
$quote      = $session->getQuote();
$items      = $quote->getAllItems();
$data       = array();

$totals     = $quote->getTotals();
$subTotal   = $totals['subtotal']->getValue();
$grandTotal = $totals['grand_total']->getValue();

The frontend is of course adding products that exist.
My best guess is that the fact that Laravel's bootstrap process starts the session before Magento comes in to play is a problem. If so, the question might be "how to "inject" a session into Magento programmatically".
What am I doing wrong?


texts: Get custom attribute value in Magento2 product page

texts:
I have created one custom attribute through code, in admin product edit page,but i wolud like to display that value in product detail page,

How to get the custom attribute collection in product detail page magento2.

i have tried with the below code but it is giving an error:

$_attributeValue = $_product->getResource()->getAttribute ($_code)->getFrontend()->getValue($_product);

Fatal error: Uncaught Error: Call to a member function getFrontend() on boolean in

Help me thankful

Thanks


texts:
I need to call right banner here bello my code is

 title="" src="{{media url='banner/right-banner.png'}}" alt=""
> width="100%" />  inline-block;"> url='banner/right-banner.png'}}" alt="" width="100%" />  style="margin-bottom: 5px; display: inline-block;"> class="img-responsive" title="" src="{{media
> url='banner/right-banner.png'}}" alt="" width="100%" />

I created static block And called this on home cms...

I want to know that how can I call this as a widget ...
How can we create widget and what is widget, Is it different then static block..


texts: remove unsecure content from modals-wrapper

texts:
Out of the box Magento 2 adds <div class="modal-content" data-role="content"> div at the end of the code.  I am not sure what it is supposed to do.  But it contains a login form with password input.  Chrome/firefox are now signalling any pages that ask for sensitive information that are not served over SSL.  So every page of Magento 2 will show as "not secure" in Chrome where the SSL info is shown.  It is because of this line of code:

<input name="login[password]" autocomplete="off" class="input-text" id="pass" title="Password" data-validate="{required:true, 'validate-password':true}" aria-required="true" type="text">

Changing type to text removed the error.  But I do not know which file is generating this.  And if other login forms use the same code, their password entry will be visible instead of ****

Maybe it is coming from vendor\magento\module-customer\view\frontend\web\template\authentication-popup.html but whenever I change the code there it does not affect my magento pages.  (flush, reindex, compile etc)

I do not want to run the entire frontend in SSL & do not want the "not secure" error - which is misunderstood by many.

Is there any way to fix this?  Where is the code to edit the output of the problematic password input?

This is the chrome inspector HTML output for a fresh 2.1.5 install on blank theme after static:deploy


texts: Magento 2 Join Product Name To Custom Grid DI Not working

texts:
I have an adminhtml custom grid that has a product_id that I need to join the product name to using this product id. I need to use dependency injection to load the attribute manager and store manager so I can do this. Here is the code in my Collection. I have marked ** will not load by the 2 classes I need which when I try to load the page, make it error out. If I comment out the lines that inject the 2 classes, the grid loads fine:

    public function __construct(
    \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
    \Psr\Log\LoggerInterface $logger,
    \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
    \Magento\Framework\Event\ManagerInterface $eventManager,
    \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
    \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null,
    \Magento\Eav\Api\AttributeRepositoryInterface $attrRepoInt, // ** will not load
    \Magento\Store\Model\StoreManagerInterface $storeMan // ** will not load
) {
    $this->_eventManager = $eventManager;
    $this->_attrRepoInt = $attrRepoInt;
    $this->_storeMan = $storeMan;
    parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
}

So the idea is that if I can get access to these 2 classes, then my join code would be like this:

    public function joinProductNames()
{
    $productNameAttributeId = $this->_attrRepoInt->get('catalog_product', 'name');
    $storeid = $this->_storeMan->getStore();
    // join product entity varchar where attributeid = $productNameAttributeId
    // and entity_id to product_id of my table, where store id = $storeid
    return $this;
}

Then in the Grid/Collection I can just call this, I have done this fine with other joins but they did not require access to other classes in the Collection:

    protected function _initSelect()
{
    parent::_initSelect();
    $this->joinProductNames();
    return $this;
}

So my question is how do I get those 2 classes to load? Or how can I get access to product name via product id some other way? My preference is to join in the grid so that it has better performance rather than making a column render.

** Edit **
Just a note, I can get this working by manually instantiating the object manager and getting the ids I need, but I'd prefer if I can do it the way that I am supposed to be doing it by using the DI in the constructor. Here is the "hack" method:

    /**
 * Join Products table to get product names
 *
 * @return $this
 */
public function joinProductNames()
{
    $attr = $this->getAttributeIdofProductName();
    $storeid = $this->getStoreId();
    $this->getSelect()
        ->joinLeft(
        ['catalog_product_entity_varchar' => $this->getTable('catalog_product_entity_varchar')],
        "main_table.product_id = catalog_product_entity_varchar.entity_id",
            ["product_name" => "value"])
        ->where(
            "catalog_product_entity_varchar.store_id = " . $storeid)
        ->where(
            "catalog_product_entity_varchar.attribute_id = " . $attr
    );
    return $this;
}

/**
 * Get EAV id of the product name attribute
 *
 * @return mixed
 */

private function getAttributeIdofProductName(){
    $om = \Magento\Framework\App\ObjectManager::getInstance();
    /** @var \Magento\Store\Model\StoreManagerInterface $manager */
    $attr = $om->get('\Magento\Eav\Api\AttributeRepositoryInterface');
    $productNameAttributeId = $attr->get('catalog_product', 'name')->getId();
    return $productNameAttributeId;
}

/**
 * Get store id of current store id of admin
 *
 * @return int
 */

private function getStoreId()
{
    $om = \Magento\Framework\App\ObjectManager::getInstance();
    /** @var \Magento\Store\Model\StoreManagerInterface $manager */
    $manager = $om->get('Magento\Store\Model\StoreManagerInterface');
    $storeid = $manager->getStore()->getId();
    if($storeid == 1){
        return 0;
    } else {
        return $storeid;
    }
}


texts: Magento 2.0.2 giving error -Failed to load resource: the server responded with a status of 404 (Not Found)


texts: Is it possible to change filters by category?

texts:
I want to be able to change the filters that appear depending on the category selected. Important to note that some categories may have the same products and that there may be multiple attribute sets so I can't do it by product.

I need to be able to say "for this category, display these filters"...anyone come across anything like that? I've seen some code changes involving hard coding category ID's but I need it to be user friendly (i.e. it won't just be me updating) so I'm guessing an extension would be useful but I can't find one anywhere that does this!

Your help as always much appreciated :-)


texts: Can anyone please tell me how we can make header in left column so header will be moved to left side. I have attached the website screenshot how i want. any help will be most most appreciated.


texts:
For a product I have a catalog price rule and tier price.

When I add item to cart Magento always takes the least price. Is there any way to set it to take price according to catalog price rule always?

I searched but didn't get a solution for this. Is there any admin settings for this?


texts:
I am building a new site using Magento 2.1 Community and am trying to add some fairly standard pages. I have no trouble adding these pages from Content->Elements->Pages->Add New Page but when I navigate to their link there is no header and footer on the page.

Looking for a guide link to how this is typically setup, I did run through the user guide and on this page:  it just has a note

"Now that your page is complete, it can be added to your store navigation, linked to other pages, or added as a link in the footer of your store. You can also use it as your new home page."

What are the typical steps I need to follow to add the site header bar to this page (or visa versa, not sure on the relationship there) and do so for all content pages I create.

I am using the default Luma theme. Various posts suggest editing a variety of xml files. Am I better served to create my own theme to preserve these changes or is there a module I should consider to make this process easier or is there a more complete guide that someone can point me to which will help answer this?

I am coming from a string familiarty with standard CMS's like Drupal and Wordpress as well as SaaS eCommerce like Shopify so aware of CMS fundamentals just not how they are handled in Magento.


texts: Magento 2 : Equivalent block class for CatalogSearch Layer?

texts:
What is the equivalent class for Magento2x for the below:

core\Mage\CatalogSearch\Block\Layer.php  (Mage_CatalogSearch_Block_Layer)

Cause in Magento2, we have only CatalogSearch/Result.php

Problem:

I want to convert these 2 classes in Magento 2

1.

class Vendor_Module_Block_CatalogSearch_Layer extends Mage_CatalogSearch_Block_Layer{

    public function canShowBlock() {

      if($service) {
        return true;
      } else {
        parent::canShowBlock();
      }

    }
}

2.

class Vendor_Module_Block_Catalog_Layer_View extends Mage_Catalog_Block_Layer_View

    public function canShowBlock() {

      if($service) {
        return true;
      } else {
        parent::canShowBlock();
      }
    }
}


texts: Email id and password validation not working in pop up

texts:
once we click on button in product view page we are displying pop up form to login or Register, here "email" & "password" validation is not working. if we enter wrong email id and password , still allowing to click Login button.

but its doing other validation like " email id format , 6 entries in password field"

<?php if (!Mage::getSingleton('customer/session')->isLoggedIn()): ?>

            <?php echo $this->__('Login into your Account 4') ?>

       <form action="some code" id="ajaxlogin-login-form">

                    <input type="hidden" id="likeproduct_id" name="product_id" value=""/>
                        *<?php echo $this->__('Email Address') ?>

                            <input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />

                        *<?php echo $this->__('Password') ?>

                            <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />

                    <?php echo $this->getChildHtml('form.additional.info'); ?>

                <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><?php echo $this->__('Login') ?></button>

        </form>

<?php endif; ?>


texts: Magento 2 results page title font size change

texts:
I'm trying to change the font size on the search results page for the 'Search results for:'.
It's currently 46px.
It's in the 'page-title-wrapper', 'page-title', 'base'.
I have a custom theme and a '_custom.less' in app/design/frontend/custom_theme/web/source/ folder.
I've added the following:
.page-title-wrapper .page-title .h1 {
font-size:22px !important;
font-weight:normal !important;
}
I've compiled and cleaned the cache but the font size doesn't change.
Can anyone advise please?
Many Thanks
Andy


texts: trouble in create custom table for custom model

texts:
I get some trouble in auto create table for model . I create module 'rewardpoint' by moduleCreator and it generate rewardpoint model automatically,But i want to create new Model 'rate' in my module . So , this is my code :

-config.xml

<models>
        <rate>
            <class>Magestore_Rewardpoint_Model</class>
            <resourceModel>rate_mysql4</resourceModel>
        </rate>
        <rate_mysql4>
            <class>Magestore_Rewardpoint_Model_Mysql4</class>
            <entities>
                <rate>

rewardpoints_rate

                </rate>
            </entities>
        </rate_mysql4>
    </models>
<resources>
        <rewardpoint_setup>
            <setup>
                <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </rewardpoint_setup>
        <rewardpoint_write>
            <connection>
                <use>core_write</use>
            </connection>
        </rewardpoint_write>
        <rewardpoint_read>
            <connection>
                <use>core_read</use>
            </connection>
        </rewardpoint_read>
   </resources>

And in sql folder , i change code too

$installer = $this;

$installer->startSetup();

/**
 * create rewardpoint table
 */
$installer->run("

DROP TABLE IF EXISTS {$this->getTable('rewardpoints_rate')};

CREATE TABLE {$this->getTable('rewardpoints_rate')} (
  `rate_id` int(11) unsigned NOT NULL auto_increment,
  `direction` smallint(6) NOT NULL,
  `point` int(11) NOT NULL,
  `money` int(11) NOT NULL,
  `customer_group` varchar(20) NOT NULL ,
  PRIMARY KEY (`rate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");

Then i refesh browser and see my phpadmin result , there's no table name 'rewardpoints_rate'.


texts: How to downgrade the setup version of a extension in magento2?

texts:
Suppose I have Magento extension Company_Setup and version v1.0.0.

I update the version with some DB change v1.0.11
I have installed the extension and now in DB version update with 1.0.11.

But suddenly I need to revert the changes where extension version is v1.0.0
then it shows the mismatch version issue after running all Magento commands.

Is there any command to deploy the previous database version when reverting the module changes?


texts: Running setup:di:compile Validation Without doing a Full Compile

texts:
Is there a way to run that validations from Magento 2's setup:di:compile without doing a full compile?  The setup:di:compile command runs a number of validations on every class file it processes. For example, it checks that you're not declaring a dependency that exists in a context object

Is there a way to run these validations without doing a full compile?  The setup:di:compile command can take long time to run, and there's nothing more frustrating at the end of a project than

Run the compiler
Wait 5 minutes
See the error
Run the compiler again
Wait another 5 minutes
See the next error

If there was a way to run these validations stand alone it would make developers life's a bit more pleasant.


texts: Using the Magento Catalog Widget options for my own Widget

texts:
The widget I'm building shows 4 products on the homepage. These products are required to be configurable (Example: multiple colors), have a custom cache timeout, and easily selectable in the options panel. I think the Catalog Widget options might be perfect for that.
How would I be able to use my own logic + the Catalog Widget options in one widget?
Right now I'm using a custom made ProductChooser but the code for that is outdated. The only part I'm still using is the Vendor\Module\Block\Widget\FeaturedProducts Block.
widget.xml
<widget id="featured_products" class="Vendor\Module\Block\Widget\FeaturedProducts"
            is_email_compatible="false" placeholder_image="Magento_Cms::images/widget_block.png">
        Homepage: Featured products
        <description>Featured products</description>

        <parameters>
            <parameter name="title_suffix" xsi:type="text" visible="true" required="true">
                Titel (suffix)
            </parameter>

            <parameter name="product_ids" visible="true" required="true" xsi:type="block">
                Producten
                <block class="Vendor\Module\Block\Adminhtml\Widget\ProductChooser">
                    <data>
                        <item name="button" xsi:type="array">
                            <item name="open" xsi:type="string">Selecteer producten...</item>
                        </item>
                    </data>
                </block>
            </parameter>
        </parameters>
    </widget>

If you have any suggestions or criticism, I would love to hear it.


texts: How to print all magento configurations (config array) : Magento 2

texts:
We can get individual configuration of magento 2 using:

echo $this->getConfig('xxxx/xxxx');

But is there any way where we can print/show all the configurations which exists in configuration array for magento 2

I have tried as print_r($this->getConfig()); but no result.


texts: Magento 2 - CMS Specific page_layout XML and Dedicated page_layouts in general?

texts:
I'm looking for some BEST PRACTICES insight into using page_layout.xml. Is it a good idea to try and decouple the non-shared resources on Product Pages, Category Pages and CMS Pages? If so, what's the best way to do this? Recently found myself creating a bunch of CMS specific CSS rules for our CSM pages and I knew the CSS rules may continue to grow a bit so I decided to create a dedicated layout file (Magento_Theme\page_layout\cms_layout.xml). To achieve this, I created a new page_layout but also had to make a plugin beforeRenderResult() to load in in <body> BOTH the standard class page-layout-2columns-left and the new class page-layout-cms-layout. If I didn't do this, I would have had to modify a lot of CSS.

Some of the benefits I think I'm realizing are:

(Maintenance) I no longer have to manage a lot of Content > Page >
Design > Layout Update XML content. I can just change the "Layout" dropdown to the CMS Specific Layout.
(Slight Performance) I don't have to load the CSS for the CMS pages
on the Product Pages and Category Pages

Next up - might be to look at some of the heavy UI JS/CSS being used on Product Pages and not have that being loaded on Category Pages? Does this situation make sense to experiences Magento Developers OR should I provide more clarity?

I'm pretty certain I'm not making any big performance gains with this particular situation but I am curious whats "Best Practice". As it stands, it seems like Magento load the the entire websites resources on every page, no matter how big or small (Category JS/CSS, Details JS/CSS, Checkout JS/CSS, etc). I'm not sure that's great either.


texts:
When I try to load product by string:
$P->loadByAttribute('my_attr', '123'); it's work. When I try the same by variable: $P->loadByAttribute('my_attr', $v); where $v is a string variable containing '123' it don't. Why?


texts: Increase maximum product price in Magento 2

texts: I'm using magento verison 2.1.4, when i tried to set the product price more than 100,000,000.00 it always set to 100,000,000.00 , is there a way to increase maximum product price?


texts: Check Component Dependency, no obvious error

texts:
I am creating a test environment for magento, hoping that I can replicate later for some work on it, and have come up an issue on Check Component Dependency. the base config is as followed:

Specs are as followed:
MAMP PRO 4.4.1
M2.1.9 CE (Clean)
php 7.0.27

I have installed as per MAMP Pro advice on their site (https://documentation.mamp.info/en/MAMP-PRO-Mac/How-Tos/General/SetupComposer/), with downloading to composer via Terminal into the magento directory and run the following commands:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

I have also run this command as well as part of a different sequence.

php composer-setup.php --install --no-dev

but this doesn't seem to work at all, terminal is saying all is ok (install wise), and the PHP is the correct PHP (check with "which php"), given there is a local machine php and mamp pro php.


texts:
possible display Product Detail in different page?
i want add new page and add display product with button checkout/add to cart, quanity with dynamic price changes how this: http://sarp2.demo.aheadworks.com/authorize/index.php/subscriptions/coffee.html, possible to implement this without an Observer, i have link: http://demo.local/subscriptions/ - here need display page product details.

Thanks


texts: Magento 2 : Allow special character at the end in password

texts:
I want to allow special character at the end of string, something like Test123@. I have used the following regex. Can anyone help me how can i acheive it
[^a-zA-Z0-9]
Thanks


texts: FPC (lesti) won't holepunch certain area

texts:
Working on a webshop with lesti:fpc + redis and magento caching.
Now i encounter the problem that (when lesti fpc is enabled) holepunching a certain module isn't working.

The part view2.phtml (Zeon_Manufacturer_Block_View) isn't working.
Other parts like the layered navigation, breadcrumbs the titel etc.. are working fine.

Is there a special way to set this up or whatever?
Cleaning the cache everytime i visit a brands page isn't working offcourse.
For now i use Mage::app()->getCacheInstance()->cleanType('block_html');

Thanks in advance!


texts: How to change the type of a constructor parameter through dependency injection

texts:
We are facing the following situation:
We use a module that is not longer maintained by the developers, but we still would like to use this module. The problem is, the code is not compatible with Magento 2.2.2. In detail, the type of aconstructor's parameter of a Magento_Framework's abstract class has changed. One of the objects in this module inherits from this abstract class and calls the old constructor. Thus, the setup:di:compile command crashes.
Our preferred solution is to create a custom module and change the type of the constructor parameter through dependency injection. So, we do not have to change the code of the not-longer maintained module.

This is the error:

Compilation was started.
Interception cache generation... 6/7 [========================>---]  85% 32 secs 308.0 MiBErrors during compilation:
  Vendor\ModuleThatIsNotLongerMaintained\Model\ResourceModel\Collection
        Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Magento\Framework\Model\ResourceModel\Db\AbstractDb; File:

Total Errors Count: 1

  [Magento\Framework\Validator\Exception]
  Error during compilation

This is the constructor of the Vendor\ModuleThatIsNotLongerMaintained\Model\ResourceModel\Collection:

public function __construct(
    \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
    \Psr\Log\LoggerInterface $logger,
    \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
    \Magento\Framework\Event\ManagerInterface $eventManager,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    $connection = null,
    \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
) {
    parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
    $this->_storeManager = $storeManager;

    if ($storeViewId = $this->_storeManager->getStore()->getId()) {
        $this->_storeViewId = $storeViewId;
    }
}

And this is the constructor of the parent class (Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection):

public function __construct(
    \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
    \Psr\Log\LoggerInterface $logger,
    \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
    \Magento\Framework\Event\ManagerInterface $eventManager,
    \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
    \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
) {
    $this->_eventManager = $eventManager;
    parent::__construct($entityFactory, $logger, $fetchStrategy, $connection);
    $this->_construct();
    $this->_resource = $resource;
    $this->setConnection($this->getResource()->getConnection());
    $this->_initSelect();
}

We were able to solve this error by directly changing the type of the parameter connection in the Vendor\ModuleThatIsNotLongerMaintained\Model\ResourceModel\Collection to \Magento\Framework\DB\Adapter\AdapterInterface, but this is not the solution we aim at.

If we correctly understand the documentation, it should be possible to change the type of constructor parameters through dependency injection.

This is the excerpt of the di.xml of our custom module:

...
<type name="Vendor\ModuleThatIsNotLongerMaintained\Model\ResourceModel\Collection">
    <arguments>
        <argument name="connection" xsi:type="object">Magento\Framework\DB\Adapter\AdapterInterface</argument>
    </arguments>
</type>
...

We activated the new custom module and cleaned the caches. But we still get the same error when executing the setup:di:compile command.

Did me misunderstood the documentation or did me missed anything?

We appreciate any advice or help!


texts:
For filtering purpose I have Manadev extension for this filter count showing wrongly.

For example I have category called "shirt". In this category having only two products, but price filtering showing like this.

  0-100(1)
  101-200(1)
  200-300(1)
  300-400(1)

Like this it's showing. When I click on first two it's showing products. 3rd and 4th showing empty.
I don't know what is happening.


texts: Programatically Create Order in Magento 2.1

texts:
Has anyone figured out how to programatically create an order in Magento 2.1 yet ?

There are a few tutorials kicking around for 2.0 which work nicely but every since I upgraded it no longer works. The error I most often see is:

  Exception #0 (Magento\Framework\Exception\NoSuchEntityException): Cart 88 does not contain item 91

Obviously the cart ID and item ID change with every attempt.

I have been looking at admin order create and the only difference is when we hit the file:

vendor/magento/module-quote/Model/QuoteRepository/SaveHandler.php

In the save() function when processing an order in the admin $items = $quote->getItems(); is null whereas when programmatically creating an order we have an item still.

Anyone know why this is happening? Or just know how to create an order?

My class can be found here:
https://gist.github.com/TheFrankman/21fdf70883d4e2d717333ac67f1e0f2d

But there is quite a lot going on. Most logic happens in function createOrder().

If you use the code that's in this question : How to create order programmatically in Magento 2?

You will get the same error. It might be easier to follow than my example

EDIT:

Big thanks to Jaimin Parikh for helping me out with this.

I thought it might be useful to put together a quick blog post about the differences between 2.0 and 2.1 now that I've solved my problem with a more simplified example. Here is the link:

http://frankclark.xyz/magento2-1-programatically-create-order

==============================

Another side note to this if anyone still has problems after the above. You need to us the environment emulation. Various checks in magento core get the current store view, which, if you are running this from a cron for example, will return as store id 0 which may not match the quote that you are creating.

\Magento\Store\Model\App\Emulation $emulation


texts:
I'm trying to remove the jcarousel script (it is located in js/ folder and not skin/ folder) from the category page.
This script is added in local.xml file of my theme:

<action method="addJs"><script>hellothemes/jquery.jcarousel.min.js</script></action>

Now,
I add this row in the <default> tag of catalog.xml:

<reference name="head">
 <action method="removeItem"><type>js</type><name>hellothemes/jquery.jcarousel.min.js</name></action>
</reference>

but nothing changes.

Any solution?


texts: Upgrade to 1.9.2.1 caused duplicate transactions in Google Analytics

texts:
After digging through and analyzing the data being sent from Magento to Google Analytics (GA), it seems that after the 1.9.2.1 update was applied to the site, Magento began sending successful transactions in duplicate to GA.

Analyzing a "Duplicate Transactions" report in GA, there's a clear transaction where it goes from 1 transaction sent / order to 2. Tracking that order number and comparing it to the commit history in the repo, the only update made to the code base on that date was the launch of the new version 1.9.2.1.

The code is properly implemented in the success.phtml page as expected, and runs the GA Universal Tracking code. There are other conversion code snippets on the page, they all show a duplication after the date in question.

Has anyone else experienced this? Anyone have any idea as to why this would be happening or a solution?

Any help would be greatly appreciated!

Thank you!


texts: Change 'Sort by Position' text to 'Sort by New' Magento 2.2.6

texts:
This must/should be easily achieved...I am simply hoping to change the 'Sort By Position' text to 'Sort by New' in the Magento category list toolbar.

I have attempted to do this by creating the folder i18n, within my theme folder in the app/ and pub/ directories, and adding the translation in 'en_US.csv'.

This doesn't seem to have had any affect... can anyone please suggest how this is achieved?


texts: Magento 2: How to generate category url with underscore?

texts:
I am importing categories from external script. All working fine with import.
But with URL KEY Magento is changing value automatically.   And I want the url same as I am passing from script.

1) Man_Jeans-1-1  //I am passing from script
2) man-jeans-1-1  //Magento saving like this

1st one is the value that is passed from script like,

$cleanurl = "Man_Jeans-1-1";
$category->setUrlKey($cleanurl);

But value is automatically changed like 2nd one.   Is there anyway I can fix this issue?
 I don't want Magento to change the url key.

Thanks,


texts: How to allow only one product in a cart?

texts:
We have a requirement, wherein a customer will be allowed to add only one product to the cart at a time. However he/she can add any quantity of that product.

How can I prevent a product from adding to cart if there is already a product present in the cart?

Can some one help on this?


texts:
In the sales_order_save_after event I am processing the order. Using getPrice() I get the original price of the product. How do I get the price according to my current user group?

$quote =  Mage::getModel('sales/quote')->load($order['quote_id']);
$items = $quote->getItemsCollection()->getItems();
foreach ($items as $order_item)
{
    #$product = $order_item->getProduct();
    $product = Mage::getModel('catalog/product')->load( $order_item->getProductId() );
    Mage:Log( round($product->getPrice(), 2) );
}


texts:
I have an admin grid that I'm using, and pulling in custom model and displaying. Everything works fine, and all columns can filter/sort, except when I try to use a column that is not inherent to my custom model. Specifically, I'm trying to use a join from my custom model to another custom table, and then from there to another custom table, all using flat tables.

I've included my _prepareCollection() and my _prepareColumns() functions for reference. I'm doing my joins in my _prepareCollection() function, and this is an acceptable solution for my grid if I can get filtering working, but it would be preferable to move the joins into my custom model collection instantiation, so this custom column is always accessible when using my model.

It may also make sense to add a function in my model collection that specifically loads the contents of the joins, but is separate from instantiation. This may lower the overhead in times when I'm interacting with my model but do not need the extra column.

I'm looking for a suggestion as to which of the latter two solutions is a better one, and a way to implement it, or if this cannot be provided, a way to get filtering working when my joins are within the grid.

Thank you, help appreciated!

protected function _prepareCollection()
{
    $collection = Mage::getModel('mymodel/post')
        ->getCollection()
        ->addFieldToFilter( 'post_type', array('eq' => 'post') );

    // Join to additional wordpress tables so we have all the data we need
    $collection
        ->getSelect()
        ->join(
            'tag_relationships',                                                                                // Alias
            'id = tag_relationships.object_id',                                                                       // On clause
            array('tag_ids' => 'tag_relationships.tag_id')                                                 // Column
        );

    $collection->getSelect()->join(
        'tags',                                                                                // Alias
        'tags.tag_id = tag_relationships.tag_id',
        array('tags' => new Zend_Db_Expr('group_concat(`tags`.name SEPARATOR ", ")') )  // Group concat
    );

    $collection->getSelect()->group('main_table.id');

    $this->setCollection($collection);
    parent::_prepareCollection();
    return $this;
}

protected function _prepareColumns()
{

    // Save the ID of the product we're editing
    $productId = Mage::app()->getRequest()->getParam('id');
    $map = Mage::getModel('mymodel/post')->load($productId);

    $helper = Mage::helper('company_mymodel');
    $currency = (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE);

    $this->addColumn('itemCheckbox', array(
        'index'      => 'ID',
        'type'       => 'checkbox',
        'width'      => 20,
        'sortable'   => false,
        'field_name' => 'map[]',
        'values'     => $map->getRelatedProjects($productId)
    ));

    $this->addColumn('id', array(
        'header' => $helper->__('ID'),
        'index'  => 'ID'
    ));

    $this->addColumn('tags', array(
        'header' => $helper->__('Terms'),
        'index'  => 'tags',
        'filter_index' => 'tags',
        'filter_condition_callback' => array($this, 'tagsFilter')
    ));

    $this->addExportType('*/*/exportRelatedCsv', $helper->__('CSV'));
    $this->addExportType('*/*/exportRelatedXml', $helper->__('XML'));

    return parent::_prepareColumns();
}


texts: data-mage-init breaks in cms static blocks or pages - how do i get an accordion?

texts:
I have been trying to have some blocks with collapsible content, but to put them in cms blocks so the text can be maintained by a normal human

I have found, thanks to previous stack discussions, that the syntax in the magento documentation needs extra quoting for it to save properly. It works. BUT IT ONLY WORKS FOR ONE SAVE, THEN IT BREAKS

        Title 1

        Content 1 bla bla bla.

        Title 2

        Content 2 bla bla bla.

If I put this in and save works fine on the front end

The problem I have is that the next time I open the editor, under the scenes the html has been changed to

and that, on saved, gets garbled to

which obviously will not work to trigger an accordion  and will also break other elements which rely on data-mage-init and RequireJS

Note the same happens on a CMS page.

I have tried putting it as

and that, saved, also work - but on the next opening it too gets turned into

and breaks again.

So on an edit one must show source and fix that line, before saving, every time, else the block breaks.

Has anyone figured out how data-mage-init can be formatted to not break in a cms block?

putting the
 call in the "parent" content where the cms block is put in as a widget didn't work either - though a wrapper block calling that block did work. But that is a ridiculously unmaintainable option - as is creating a whole new widget and content editing section just so I can add content that uses a built in layout option!

I have considered creating a custom block template that would have the accordion code but then I lose the ability to set what tabs are expanded on open, or any other flexibility.

Is this truly impossible or can these data-mage entries work in cms content? How can i put a maintainable bit of accordion content in my pages?


texts:
I followed Magento Doc and created checklogin.php, endpoint.php, login.php and OauthClient.php.

As the doc says in checklogin.php, there is

$credentials = new \OAuth\Common\Consumer\Credentials($consumerKey, $consumerSecret, $magentoBaseUrl);
$oAuthClient = new OauthClient($credentials);

When I try to activate API Integration, It is giving error:

Fatal error: Uncaught Error: Class 'OauthClient' not found in /public_html/magento2/checklogin.php:22 Stack trace: #0 {main} thrown in /public_html/magento2/checklogin.php on line 22

Where should I place the OauthClient.php file?


texts: crc_string field in the translation table

texts:
What is the role of the field crc_string in the translation table?
I know what crc is in general, but how is this field used to detect  (and maybe correct) errors in the strings, if this is its real use at all?


texts:
We are currently connected to our vendor/warehouse using ShipStation. We need to also connect to a totally different vendor/warehouse using Shipworks.

How do we integrate both and also have Magento use both together?

If someone orders Product A, the order is sent to ShipStation.
If someone orders Product B, the order is sent to ShipWorks.

If someone orders Product A & Product B, the order is split and Product A gets sent to ShipStation and Product B gets sent to ShipWorks.

Thanks.


texts: Magento2 Development - System Requirements

texts:
Hi Magento2 Developers,

In your experience, what are the system requirements (cpu, ram, etc...) for a fully featured development machine and what softwares are you using?

"fully featured" meaning:

Source-Code Indexing (incl. dependencies)
Code-Competition (incl. dependencies)
Code-Inspections
XDebug
and every other feature required in daily work

I am running a Linux Desktop (xfce), Ide (PhpStorm) & Browser (Chrome) on my development machine with an Intel E3-CPU and 8GB Ram.

In my experience it would need at least 16GB Ram to run without swapping like crazy.


texts: Magento 2 - Load knockout content in modal popup

texts:
I want to load knockout content in modal popup on the cart page.

And to be able to bind button/click events.


texts: Translate reserved fields in admin Magento2

texts:
I'm trying to translate the label of each fields which is described in below screen shot. I'm using Magento 2.1.6.

I have created a language pack in this directory: app/i18n/xxx/yyy/magento2-pt_br/module-backend.csv

Also I have executed the following commands.

php bin/magento setup:upgrade && chmod 777 -R var && chmod 777 -R pub

php bin/magento setup:static-content:deploy pt_BR --theme xxx/yyyy_zzzz

php bin/magento setup:static-content:deploy pt_BR --theme Magento/backend

cd var && rm -R *

php bin/magento setup:upgrade && chmod 777 -R var && chmod 777 -R pub

But labels are not getting translated with my custom csv file. I do not know what else to do. Thanks for any help.


texts: getUrl fails to generate proper key, so admin link redirects to dashboard

texts:
In my block file:

$link = $this->getUrl('admin/user/edit', ['user_id' => 2]);

It generates a link that looks right but it redirects to the dashboard and comparing the link in the admin to that same user while logged in the only difference is the key.

I tried ones without arguments too:

$link = $this->getUrl('admin/user/index');
$link = $this->getUrl('admin/user/index',['_use_rewrite' => true]);

Both fail to generate a link that doesn't redirect to the dashboard.


texts: Products Type : Grouped Product - How can i create discount for grouped product

texts:
I need to add discounts price for grouped products. eg : item : 1 = 10, item : 2 = 20, when Item  add to cart how can i display total amount is 25(discount is 15 %),

My Workout :
screen shots :

Its Not Working
 i just want to add discount for grouped products, in my grouped products 3 products, front end display normal price, after add to cart the price should be discount 15 %


texts: Display custom options on category page and allow add to cart

texts:
I want to display product's custom option on listing page and want to allow customer to add to cart from the category listing page.
I have added Qty field and following code to display the custom option on listing page.
           <?php

    $_objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$customOptions = $_objectManager->get('Magento\Catalog\Model\Product\Option')->getProductOptionCollection($_product);
 $optStr = '';
foreach($customOptions as $optionKey => $optionVal):
    //$optStr .= "<div class='custom-options'><label>".$optionVal->getTitle()." </label>";
        $optStr .= "<select name='options[".$optionVal->getId()."]'>";
        foreach($optionVal->getValues() as $valuesKey => $valuesVal) {
        $optStr .= "<option value='".$valuesVal->getId()."'>".$valuesVal->getTitle()."</option>";
            }

    $optStr .= "</select>";
endforeach;
   echo($optStr );

 ?>

Using above code custom option  is displaying. But when we add to cart, it's not adding product to cart with custom option and being redirected to product page.
How can I make add to cart with custom option on the category listing page?
any help would be appreciated.


texts: Get User credentials with an Observer on customer_register_success event

texts:
At the moment, I have an observer that fires on the customer_register_success event. this observer comes with a property ["customer"]. Is there a way to retrieve the email + password from this object, without modifying the core Magento code?

Basically, the use case is that a non Magento account must be created at another application, whenever a new customer registers through the Magento store.

I appreciate any help!


texts: In magento 2.1 default search option is there, but i need to show all category names left side of search button (drop down menu) , if i select one category and select anything with some text, it will search in that selected category only.


texts:
I am getting below data on
customer data GraphQL query
const query = () => ({
  query:
    {
      customer {
        customer_id
        firstname
        lastname
        suffix
        email
        addresses {
          id
          firstname
          lastname
          street
          city
          default_billing
          default_shipping
          region {
            region_code
            region
          }
          postcode
          country_code
          telephone
        }
      }
    }

})
{
  customer: {
    id: null,
    firstname: 'User',
    lastname: 'User',
    suffix: null,
    email: 'User@user.com',
    addresses: []
  }
}

How to get customer id in this ?


texts: Calling controller path /foo/bar/baz results in 404, but is found at default/index.php/foo/bar/baz

texts:
I have set up a simple custom controller based on Alan Storm's tutorial. My controller action should be available on this URL:

http://magento.localhost/helloworld/index/index/

But this path gives a Magento 404 error. The controller is instead found on the following path:

http://magento.localhost/index.php/default/helloworld/index/index/

I don't understand why is this happening, as all of the tutorials and articles I found on the net tell me, that this should be working like that, none of them mention any extra tinkering. This problem is the same for built-in controllers too. This is a base CE 1.7 installation with sample data.

Can anyone shed some light on the matter? Thanks!


texts: Area configuration aggregation error after install Porto theme

texts:
i try install Porto theme to Magento 2.3.1, but i get some problem. I try

sudo php -f bin/magento setup:di:compile
sudo rm -rf pub/static/*/*; sudo rm -rf var/*/*;
sudo php -f bin/magento setup:static-content:deploy -f
sudo php bin/magento cache:clean

this commands for magento and

sudo addgroup webmasters
sudo adduser $USER webmasters
sudo chown -R root:webmasters /var/www
sudo find /var/www -type f -exec chmod 664 {} \;
sudo find /var/www -type d -exec chmod 775 {} \;
sudo find /var/www -type d -exec chmod g+s {} \;
sudo chown -R www-data:webmasters application/cache/ [etc...]

more for set up permissions. I attach some pictures about problems. What is solution?
Thank you in advance for your help


texts:
If I search any keyword through the website , it's showing me the data but when I search the same keyword via Solr panel, most of the times showing no data .

I try to search using SKU , which is 100% working fine.

Is my Magento working with Solr search perfectly ?


texts: Change currency once we send the payment to payment gateway

texts:
in my website i have mainly USD and AED currency . Base currency is USD . Recently i integrate a payment gate way to my website . But that payment gateway only accept AED Currency .
So is there any way when sending to payment gateway we can change the currency to AED . Please help .


texts: Custom modules disappeared after 2.2.9 upgrade

texts: All custom modules have disappeared after upgrade to 2.2.9 from 2.1.9. When I run bin/magento setup:upgrade, last message is "Nothing to import." but the custom modules are not enabled and not added to the app/etc/config.php file.


texts: How to change position of account dashboard section in magento 2 my account

texts:
How to reorder the account dashboard overview section as shown below

for example in the dashboard we have

Recent Orders Section
Account Information Section
Address Book Section

So I need to reorder like this

Account Information Section
Recent Orders Section
Address Book Section


texts: Category Page navigation Issue in magento 1.9.2.3

texts:
I am using magento 1.9.2.3 my customer are facing problem when they are visiting the category page from frontend. Like one category have 10 pages if customer select the product from 5th page and click on the back button then it should be stay on 5th page but now it move to the 1st page of the category.

Can anyone let me know how can i fix this issue?

thanks


texts: Change the order of "Additional Information" attributes

texts:
Is there a way to change the order of the attributes displayed on the Product View Page under the "Additional Information" section?

I find that every time I select an attribute to be displayed on the Product View Page, it gets added to the bottom of the list.


texts: I have a simple post table, how can I get lasted post in the phtml file.


texts: Magento 1.9 Can I override the registration page only for one of the stores?

texts:
I have multiple stores.

I need to override the existing registration page, but only for 1 store? How can I achieve that?


texts:
After installing Fishpig via Magento Connect I got the following error I'm racking my brains over trying to figure out how to resolve, any ideas?

Fatal error: Class 'Fishpig_Wordpress_Model_Resource_Setup' not found in /includes/src/Mage_Core_Model_Resource_Setup.php on line 234

Thanks.


texts: Font Awesome icons not rendering in my top links

texts:
I have added the Font Awesome cdn link in my header.

(default_head_block.xml)

css rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css" src_type="url"/>

Then added the link to facebook in the top links

(default.xml)
block

class="Magento\Framework\View\Element\Html\Link\Current" name="facebook" before="-"

arguments

 argument

 name="label" xsi:type="string" i class="fa fa-facebook fa-2x" /i>

/argument

argument name="path" xsi:type="string">https://www.facebook.com/

/argument

/arguments

/block

I have cleared the cache and reindexed. But the  element doesnt seem to render.

I can see the FB link, but the icon wont show.
Also, the Font Awesome CDN appears in the header so I know its loading.

What am I doing wrong?
Cheers.


texts:
I have created a product attribute with select and  modify and apply ui-select on dropdown.

Now I want to append new option value in Capacity search box so How I can do this, I have added value in database from product form by ajax and get option id in return but I am not able to append value  in box.


texts: Magento Order Mangement Confusion? No invoice automatically created?

texts:
I am a bit confused about how the orders works. I am using a national third-party service for Payment. Let's just call them, PaymentCompany.

Let me take you through an order.

Frontend
1. Customer chooses an product, add to cart and go to checkout.
2. Customer chooses shipping method and payment method which will be through PaymentCompany.
3. Customer get 'thank you'-page and leaves the website.
4. Customer also gets notified per email that an order was placed.

Backend
1. In sales->orders there is now placed an order as "processing".
2. If I now go to the order and click "invoice", there is none. Which means I have to click and create an invoice. This will again notify the customer with an Invoice.
3. Click shipment, which will notify the customer that it is shipped.

My questions:
1. Why is the Invoice not automatically created?
2. If it is so, that that's just how it works, why do the customer get notified when I create the invoice?


texts: How to create an new observer on the event catalog_product_save_before

texts:
I want auto generation of meta description for my products by create an new observer on the event catalog_product_save_before with this code :

public function autoMetaDescription($observer) {
     $product = $observer->getEvent()->getProduct();
     $metaDescription = "Buy ". $product->getName()." for Rs ".number_format($product->getFinalPrice(), 2)." at sitename.com | New Book | Authorised seller for ". $product->getAttributeText('publisher');
    $product->setMetaDescription($metaDescription);
}

In which folder/files  I have to write the code?


texts: Magento 2: Customer account create email does not show the images

texts: Hello When the user create the account user get the mail in that the images are not showing please help me how can i fix it


texts: How to add ttf file in less using typography.less file?

texts:
I want to call .ttf file instead of .woff2 file in typography.less. But, it's not call and return 404 error.
Code :
.lib-font-face(
        @family-name: @roboregular,
        @font-path: '@{baseDir}fonts/robo-regular-webfont',
        @font-weight: normal,
        @font-style: normal,
        @font-display: swap
    );

How to call it?
Please help me.
Thanks.


texts: Google Analytics Plus in Fooman using GTM not working

texts:
How to configure the Google Analytics Plus in magento 1.9.2.1?

I'm uisng GTM to implement the Google Analytics code but it seem it doesn't track the E commerce Overview.


texts: What is the "database compatible mode" in Magento?

texts:
I've run over some comment in a core file which is about database compatible mode:

In www/app/code/core/Mage/Core/Helper/Data.php:

class Mage_Core_Helper_Data extends Mage_Core_Helper_Abstract
{

    # ...

    /**
     * Check whether database compatible mode is used (configs enable it for MySQL by default).
     *
     * @return bool
     */

    public function useDbCompatibleMode()
    {
        $connType = (string) Mage::getConfig()->getNode(self::XML_PATH_CONNECTION_TYPE);
        $path = 'global/resource/connection/types/' . $connType . '/compatibleMode';
        $value = (string) Mage::getConfig()->getNode($path);
        return (bool) $value;
    }

    # ...

This mode is new to me and I'm unable to find further references to it so I thought I put it here into Q&A.


texts: Different currency symbol grand total Euros and Dollars M2.3

texts: I set my M2.3 to Deutsch but the grand total is still with $ symbol, please can you help with this issue?


texts: Issue with Customer Order Collection Magento 2

texts:
I have a problem with the default Magento core function. I really don't know whether it is a conflict with any other modules.

When we go to the customer menu in admin and select any customer from the list then click on the order tab in the customer details page. I can see that the loading image is rotating, there is no customer order I can see.

I have checked in the console there is a 500 internal server error. I have go to the class file path(vendor/magento/module-customer/Block/Adminhtml/Edit/Tab/Orders.php) and echo the SQL query.

SELECT DISTINCT `main_table`.`entity_id`, `main_table`.`increment_id`, `main_table`.`customer_id`, `main_table`.`created_at`,
`main_table`.`grand_total`, `main_table`.`order_currency_code`, `main_table`.`store_id`, `main_table`.`billing_name`,
`main_table`.`shipping_name`, `sales_order`.`coupon_code`,
group_concat(DISTINCT `sales_order_item`.sku SEPARATOR ", ") AS `sku`,
group_concat(DISTINCT `sales_order_item`.name SEPARATOR ",\n") AS `name`,
group_concat(DISTINCT `sales_order_item`.product_options SEPARATOR "|| ") AS `product_options`,
`sales_order_item`.`qty_ordered`, `sales_order_item`.`qty_invoiced`, `sales_order_item`.`qty_shipped`, `sales_order_item`.`qty_canceled`,
`sales_order_item`.`qty_refunded`
FROM `sales_order_grid` AS `main_table`
LEFT JOIN `sales_order` ON main_table.entity_id = sales_order.entity_id
INNER JOIN `sales_order_item` ON main_table.entity_id = sales_order_item.order_id WHERE (`customer_id` = '73922')
GROUP BY `main_table`.`entity_id`

The error code appears on PHPMyAdmin when I run the code

Error in the query (1052): Column 'customer_id' in where clause is ambiguous

This is the right SQL Query

SELECT DISTINCT `main_table`.*, `sales_order`.`coupon_code`,
group_concat(DISTINCT `sales_order_item`.sku SEPARATOR ", ") AS `sku`,
group_concat(DISTINCT `sales_order_item`.name SEPARATOR ",\n") AS `name`,
group_concat(DISTINCT `sales_order_item`.product_options SEPARATOR "|| ") AS `product_options`,
`sales_order_item`.`qty_ordered`, `sales_order_item`.`qty_invoiced`, `sales_order_item`.`qty_shipped`,
`sales_order_item`.`qty_canceled`, `sales_order_item`.`qty_refunded`
FROM `sales_order_grid` AS `main_table`
LEFT JOIN `sales_order` ON main_table.entity_id = sales_order.entity_id
INNER JOIN `sales_order_item` ON main_table.entity_id = sales_order_item.order_id
WHERE (`main_table`.`customer_id` = '73922')
GROUP BY `main_table`.`entity_id`, `sales_order_item`.`qty_ordered`, `sales_order_item`.`qty_invoiced`, `sales_order_item`.`qty_shipped`,
`sales_order_item`.`qty_canceled`, `sales_order_item`.`qty_refunded`

How can I convert the order.php query to this one?