texts: OptionInterfacePersistor error when compiling magento in production mode

texts:
I'm trying to run php bin/magento setup:di:compile-multi-tenant on a Magento CE 2.0.10 with sample data installed. I don't have anything else in this Magento installation.
I use php 7.0.8.

 [Magento\Framework\Exception\LocalizedException]
 Source class "\Magento\Catalog\Model\Product\OptionInterface" for "\Magento\Catalog\Model\Product\OptionInterfacePersistor" generation does not exist.

The permissions should be ok. With root I get same error.

Originally I've installed Magento from archive. Than I used composer to update the project with a module (the module is gone now).
After installing from archive I did set production mode, but I didn't spotted any errors. I'm not sure if the error was or wasn't there. One thing is to repeat the installation which I'll do.

Compiling with setup:di:compile will work (as in execute successfully the command) but in Magento 2.0.x is bugged as far as I know. Anyway the plugins in that module I was talking do not work (in developer mode work as expected).

Anyone got into this OptionInterfacePersistor error when trying to compile on a Magento 2.0.x ?

update
I installed again 2.0.10 sample from archive.
I set production mode successfully.
Run again php bin/magento setup:di:compile-multi-tenant and worked.
I run composer update -vvv.
Run php bin/magento setup:di:compile-multi-tenant and failed with same error.
In composer update I see a few external packages updated.

These are all packages updated:

- Removing phpunit/php-token-stream (1.4.8)
- Installing phpunit/php-token-stream (1.4.9)
- Removing symfony/config (v2.8.11)
- Installing symfony/config (v2.8.14)
- Removing symfony/yaml (v2.8.11)
- Installing symfony/yaml (v2.8.14)
- Removing sebastian/comparator (1.2.0)
- Installing sebastian/comparator (1.2.2)
- Removing seld/jsonlint (1.4.1)
- Installing seld/jsonlint (1.5.0)
- Removing fabpot/php-cs-fixer (v1.12.2)
- Installing fabpot/php-cs-fixer (v1.12.4)
- Removing psr/log (1.0.1)
- Installing psr/log (1.0.2)
- Removing symfony/event-dispatcher (v2.8.11)
- Installing symfony/event-dispatcher (v2.8.14)
- Removing symfony/filesystem (v2.8.11)
- Installing symfony/filesystem (v2.8.14)
- Removing symfony/finder (v2.8.11)
- Installing symfony/finder (v2.8.14)
- Removing symfony/process (v2.8.11)
- Installing symfony/process (v2.8.14)
- Removing symfony/stopwatch (v3.1.4)
- Installing symfony/stopwatch (v3.1.7)

Still don't know the cause of this.


texts:
I have created new module but it is not working.Please Help me on this.

registration

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Outdoor_Configurator',
    __DIR__
);

Module

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Outdoor_Configurator" setup_version="1.0.0">
    <sequence>
        <module name="Magento_Backend"/>
         <module name="Magento_Sales"/>
        <module name="Magento_Quote"/>
        <module name="Magento_Checkout"/>
        <module name="Magento_Cms"/>
    </sequence>
</module>

routes

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="standard">
    <route id="testconfigurator" frontName="testconfigurator">
        <module name="Outdoor_Configurator" />
    </route>
</router>

Controller

<?php
namespace Vendor\ModuleName\Controller\Index;
 class BuiltCatCollection extends \Magento\Framework\App\Action\Action
 {
/** @var  \Magento\Framework\View\Result\Page */
protected $resultPageFactory;
/**      * @param \Magento\Framework\App\Action\Context $context      */
public function __construct(\Magento\Framework\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
{
    $this->resultPageFactory = $resultPageFactory;
    parent::__construct($context);
}
/**
 * Blog Index, shows a list of recent blog posts.
 *
 * @return \Magento\Framework\View\Result\PageFactory
 */
public function execute()
{
    $resultPage = $this->resultPageFactory->create();
    $resultPage->getConfig()->getTitle()->prepend(__('Custom Front View'));
    return $resultPage;
}

}

Block

<?php
 namespace Vendor\ModuleName\Block\Index;
 class BuiltInfo extends \Magento\Framework\View\Element\Template
 {
 public function _prepareLayout()
 {
    return parent::_prepareLayout();
  }
 }

Layout

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

    <referenceContainer name="content">
        <block class="Vendor\ModuleName\Block\Index\BuiltInfo" name="outdoor_configurator" template="Outdoor_Configurator::builtcatcolinfo.phtml"></block>
    </referenceContainer>

Template

This is custom front view.


texts:
How to change the jquery into ko?

define([
        'jquery'
    ], function ($) {
        "use strict";
        $.widget('xxx.homePage', {
            options: {
                bindSubmit: true,
                sizeGuide: true
                       },
            _create: function () {
                if (this.options.bindSubmit) {
                    this._bindSubmit();
                }
            },
            _bindSubmit: function () {
                var self = this;
                $(window).on('scroll', function () {
                    // View Port top and left dimensions
                    var viewport = {
                        top: $(window).scrollTop(),
                        left: $(window).scrollLeft()
                    };
                    viewport.right = viewport.left + $(window).width();
                    viewport.bottom = viewport.top + $(window).height();

                        if ($('#size-guide').is(":visible")) {
                            var elemtHeight = $('#size-guide').height();// Get the full height of current element
                            elemtHeight = Math.round(elemtHeight);
                            var bounds = $('#size-guide').offset();
                            bounds.top = bounds.top + elemtHeight;
                            bounds.right = bounds.left + $('#size-guide').outerWidth();console.log("OUT");
                            console.log(self.options.sizeGuide);
                            bounds.bottom = bounds.top + $('#size-guide').outerHeight();
                            if (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)) {
                                if (self.options.sizeGuide) {
                                    self.options.sizeGuide = false;

                                    console.log(self.options.sizeGuide);
                                    self.sizeGuide();

                               }
                            }
                        }
                });});
        return $.xxx.homePage;
    });

            }


texts: Some Transactional Email Templates Won't Load

texts:
When I go to "System -> Transactional Emails," "Add New Template" and attempt to load the "New Order" template, nothing is returned in any field in the Template Information section. It behaves this way on both stage and production. Some of the emails will load (Payment Failed, for example) but there is nothing to indicate why my most popular email templates won't load. I was already able to update one template in our store, the New Account email.

I need to make some urgent changes to this template right away (we are currently using the default template), and it would even be helpful to find the default template posted somewhere, but my searches have returned nothing. We don't have custom code or modules that directly modify this behavior, to my knowledge. Nothing shows up in htdocs/var/log/exception.log at any point during this process.

To further clarify, when I load a template that actually works (such as "Payment Failed Template") and then go back to load the "New Order" template, the information in those fields is still the Payment Failed Template information (Subject and Content). Although I get the "Please Wait" circle onscreen for about 1.5 seconds, nothing on the page changes aside from the top Template dropdown, which says New Order.

I have also verified that the file exists in htdocs/app/locale/en_US/template/email/sales/order_new.html and am using it to build the template I need urgently.

Magento Enterprise 1.13.1.0


texts: How to create custom index to store data from product collection?

texts:
I want to create a custom index where to store data based on this flow:

Get all active products - filter on attribute (select type attribute from product) => "cases"
Foreach product get images, URL and "color" attribute
Store data and asign to a product

I need this to be done for all products (on product change) and show the data to product list (also on search)

The purpose is to show all possibilities (with images) from other products (all products that have the same value in the attribute "cases")
Implementing a custom index I've found here https://devdocs.magento.com/guides/v2.4/extension-dev-guide/indexing-custom.html but to store data or other parts I could not found.
Can someone help?


texts: How to populate data in custom filed in product edit form in Magento 2

texts:
I have added custom filed dropdown in product edit form using UI component. Below is the code in file app/code/Vendor/Module/view/adminhtml/ui_component/product_form.xml

<?xml version="1.0" encoding="UTF-8"?>

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<field name="customer" component="Vendor_Module/js/components/select-customer" sortOrder="5" formElement="select">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="filterOptions" xsi:type="boolean">true</item>
            <item name="multiple" xsi:type="boolean">false</item>
            <item name="showCheckbox" xsi:type="boolean">true</item>
            <item name="disableLabel" xsi:type="boolean">true</item>
            <item name="levelsVisibility" xsi:type="number">1</item>
        </item>
    </argument>
    <settings>
        <required>true</required>
        <validation>
            <rule name="required-entry" xsi:type="boolean">true</rule>
        </validation>
        <elementTmpl>ui/grid/filters/elements/ui-select</elementTmpl>
        <label translate="true">Select Customer</label>
        <dataScope>data.customer</dataScope>
        <componentType>field</componentType>
        <listens>
            <link name="${ $.namespace }.${ $.namespace }:responseData">setParsed</link>
        </listens>
    </settings>
    <formElements>
        <select>
            <settings>
                <options class="Vendor\Module\Ui\Component\Create\Form\Customer\Options"/>
            </settings>
        </select>
    </formElements>
   </field>
</form>

By this code, I'm able to display a drop-down with customer name and id like an option value

Now when someone edits the product, I want to preselect the drop-down value base on the data save in another table. Can anyone help me with this? I think using data provider one can achieve this but not sure

If i add a dataprovider using below tag. It is giving an error "Element 'dataSource': This element is not expected"

   <dataSource name="customfiled_customer_data_source">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">Vendor\Module\Ui\DataProvider\Product\CustomerDataProvider</argument>
        <argument name="name" xsi:type="string">customfiled_customer_data_source</argument>
        <argument name="primaryFieldName" xsi:type="string">brand_id</argument>
        <argument name="requestFieldName" xsi:type="string">customer</argument>
    </argument>
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
        </item>
    </argument>
   </dataSource>


texts: Add php function to price of Products with Custom Options

texts:
I added a php function to magento price template this way

I added this code:

<?php
function Convert2farsi ($srting)
    {
      $search= array("0","1","2","3","4","5","6","7","8","9");
      $replace= array("A","B","C","D","E","F","G","H","I","J");
      $int= str_replace($search,$replace,$srting);
      return$int;
    }
?>

to app/design/frontend/shopper/default/template/catalog/product/price.phtml

and changed this line price.phtml:

<?php $_convertedPrice = $_store->roundPrice($_store->convertPrice($_product->getPrice())); ?>

to this:

<?php $_convertedPrice = $_store->roundPrice($_store->convertPrice(Convert2farsi ($_product->getPrice()))); ?>

Problems:

Products with Custom Options wont take effect of this code and are showing in their past way.
In each category just one product is shown and the others are missing.
Product prices won't show on category hover mode and give this error on hover: cannot redeclare Convert2farsi () previously declared in .../price.phtml line 28 and 34


texts: Shipping methods are not displayed accordingly in Magento 1.8

texts:
How can I display the list of my shipping methods according to the order numbers that I have set in their input fields of Sort Order?

I have set each shipping method's Sort Order in my backoffice, but they are not displayed accordingly.

For instance, in my backoffice, I have these shipping methods,

Method Name: bestway
Sort Order: 1

Method Name: Free
Sort Order: 2

Method Name: Chronopost
Sort Order: 3

But they are not displayed in this order in frontend\argenties\default\template\checkout/cart/shipping.phtml

    <?php
    $methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
    $shipping = array();
    foreach($methods as $_ccode => $_carrier):
        if($_methods = $_carrier->getAllowedMethods()):
            if(!$_title = Mage::getStoreConfig("carriers/$_ccode/title"))
                $_title = $_ccode;

            foreach($_methods as $_mcode => $_method):
                $_code = $_ccode . '_' . $_mcode;
                $shipping[$_code] = array('title' => $_method,'carrier' => $_title);
            ?>

<input type="radio" name="estimate_method" value="<?php echo $_code;?>" id="s_method_<?php echo $_code ?>"<?php if($_code === $this->getAddressShippingMethod()) echo ' checked="checked"' ?>> <?php echo $_title;?>

            <?php endforeach;?>

        <?php endif;?>
    <?php endforeach;?>

Result,

Method Name: Free
Method Name: bestway
Method Name: Chronopost

Method Name: bestway should be on the top in the list, but it is always dropped to the second. Why? Any idea how I can fix it?


texts: How to load simple product images on configurable product in magento 2?

texts:
How we can show the images on page when load of simple product of configurable product.

By default configurable product image show but what i want when we click on color option then its associated simple product should show without click it should be on page load.

These should be shown vertically besides main image as it does magento on swatch click but i want on page load.


texts: How to list products from equal subcategories but different parents?

texts:
I have the following category tree:

Men

Shoes
Accessories

Women

Shoes
Accessories

And I need to list all shoes available (Men and Women) in a single page (mystore.com/shoes)

Any plugin/code/trick to do this?

Thanks


texts: How to show product custom attribute in items ordered section in magento2.2.0?

texts:
How to show product custom attribute with values in items ordered section in magento2.2.0?
Refer screenshot

The above image is my custom attribute(PCB Master)

In the above image i need to show my custom attribute with its value under SKU in magento2.2.0


texts: magento AW_blog tag with a blank link to access 404, how to solve, thank you

texts:
Magento aw_blog tag url This link is good,

/news/tag/test111/,

But such a link

(/news/tag/test+111/)

Cannot access the page, the system gives 404


texts: How to add/remove browser specific JS and CSS in Magento2 using layout xml

texts: Is there any facility to remove js/css specific to browser in magento2 using layout xml ?


texts: Magento2 : Missing Public Hash for payment information?

texts:
I've a site which uses Braintree with the Vault enabled. The cards appear to save correctly but no public hash is passed in the additional_data array when attempting to use it on the frontend. Below is an example of the code passed:

additional_data: {public_hash: "", payment_method_nonce: "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx", is_active_payment_token_enabler: true}

This then returns the error:

{"message":"An error occurred on the server. Please try to place the order again."}

The Magento version is 2.2.2 (enterprise), though I'm not in control of patches I can't say how up to date it is. How can I correct this missing public hash?


texts: Products not correctly sorted according to name

texts:
I have 3 products in a category. I need to sort it according to the order listed below

    **-------Expected order-------**
    Armani Code For Men 50ml EDT
    Armani Code For Men 100ml EDT
    Armani Code For Men 200ml EDT

But when i sort the products according to the name i get the order listed below

**-------Sorted according to name-------**
        Armani Code For Men 100ml EDT
        Armani Code For Men 200ml EDT
        Armani Code For Men 50ml EDT

How can i correct it to display the products according to the expected order?

-----------------Update-----------------------------

The issue seems to be that the collection is not being sort by natural sort. How can i natural sort a collection?


texts: Custom Block to Product Page with selection attribute is not showing

texts:
I am trying to create an option where I can select yes or no in the backend, and when it's set to yes, it adds a block with an image in the product page. Here's what I have so far:

I created a Yes/No Attribute called "samsung_5_vjet_garanci" and
made sure its Visible on Catalog Pages on Storefront. Added it on a sample product, and set it to YES
Created a CMS Block with just the "

" with identifier "samsung-garanci"
Created a .phtml file and uploaded it /app/design/frontend/vendor/themename/Magento_Catalog/templates/product/view/samsung.phtml

<?php $_product = Mage::getSingleton('catalog/product')
            ->load($_product->getId());

if ($_product->getAttributeText('samsung_5_vjet_garanci') == "Yes"): ?>

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('samsung-garanci')->toHtml(); ?>

<?php endif; ?>

Added a block in catalog_product_view.xml
<referenceContainer name="product.info.main">
    <block class="Magento\Catalog\Block\Product\View" name="samsung" as="samsung" after="-" template="Magento_Catalog::product/view/samsung.phtml" />
</referenceContainer>

But it's not working, what am I doing wrong, it's been 3 days figuring this out, and still nothing.
Thank you very much if you help me


texts:
I'm working with a Magento flat collection I want to do this:

$collection = 'load a certain collection';
$collection->'addsomefilters';

if (count($collection) == 1) {
    //add some additional filters to the collection
}

return $collection;

Because I will call count() on my collection, the items from the database will be loaded, and even if I get into my if, when I will return it, the collection will have the same items before entering the if.

Is there a way to count my collection without having this behaviour, or can I reload the collection and apply my additional filters?


texts:
It was all set a while ago,but got this error today.

Here is the debug log

2014-03-26T08:44:43+00:00 DEBUG (7): Array
(
    [try-0] => Array
    (
        [request] => <?xml version="1.0" encoding="UTF-8"?>
        <p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd ">
            <GetQuote xmlns="">
                <Request>
                    <ServiceHeader>
                        <SiteID>AMPROSERVE</SiteID>
                        <Password>YourPwd</Password>
                    </ServiceHeader>
                </Request>
                <From>
                    <CountryCode>TW</CountryCode>
                    <Postalcode>42751</Postalcode>
                    <City>TANTZ</City>
                </From>
                <BkgDetails>
                    <PaymentCountryCode>TW</PaymentCountryCode>
                    <Date>2014-03-26</Date>
                    <ReadyTime>PT12H00M</ReadyTime>
                    <DimensionUnit>CM</DimensionUnit>
                    <WeightUnit>KG</WeightUnit>
                    <Pieces xmlns=""/>
                    <PaymentAccountNumber>YorNumber</PaymentAccountNumber>
                </BkgDetails>
                <To>
                    <CountryCode>US</CountryCode>
                    <Postalcode>02139</Postalcode>
                    <City>Cambridge</City>
                </To>
            </GetQuote></p:DCTRequest>

        [from_cache] => 1
        [response] => <?xml version="1.0" encoding="UTF-8"?>
                    <res:ErrorResponse xmlns:res='http://www.dhl.com' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation= 'http://www.dhl.com err-res.xsd'>
                    <Response>
                        <ServiceHeader>
                            <MessageTime>2014-03-26T08:44:16+00:00</MessageTime>
                            <SiteID>AMPROSERVE</SiteID>
                            <Password>AMPROSERVE</Password>
                        </ServiceHeader>
                        <Status>
                            <ActionStatus>Error</ActionStatus>
                            <Condition>
                                <ConditionCode>111</ConditionCode>
                                <ConditionData>Error in parsing request XML:Error: The
                                content of element type &quot;Pieces&quot; is
                                incomplete, it must match
                                &quot;(Piece,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?,Piece?)&quot;.
                                at line 2, column 658</ConditionData>
                            </Condition>
                        </Status>
                    </Response></res:ErrorResponse>
    )

    [__pid] => 770397
)

What's wrong with my request xml?


texts: How is ajax call enabled on magento ? are asynchronous calls backend config on magento?

texts:
In a magento toolbar For example in this site try changing the view from grid to list, this is a demo site and it occurs by reloading the page, but in this premium theme toolbar when i toggle view (grid/list), sort or pagination from toolbar it occurs asynchronously.

I'm using this(premium) theme and i couldn't trace how it's getting asynchronously. How can i trace the function that is being called when the view is changed ?

I tried console.log($('#sort_by li a').data('click')) but his returns undefined


texts:
Iam trying build a grid in Magento , where i need to  calculate days between two dates so that i can filter days.But i could not get it right with ,

Following is the piece of collection code in grid .

preparecollection

$collection->getSelect()->columns(array('days' => new Zend_Db_Expr ('datediff(main_table.support_end_date,now())')));

$collection->getSelect()->having('days <= ?', '60');

Prepare columns

$this->addColumn('days', array(
            'header' => Mage::helper('tp_adminpurchase')->__('Days '),
            'align' => 'left',
            'index' => 'days',
            'filter_index' => 'days',
            'filter_condition_callback' => array($this, '_filterDays'),
        ));

  protected function _filterDays($collection, $column) {
        $condition = $column->getFilter()->getCondition();
        $collection->getSelect()->having('days <= ?', '60');
          return $countSelect;
    }

In collection.php , i have this

public function getSelectCountSql() {
        $this->_renderFilters();

    $countSelect = clone $this->getSelect();
    $countSelect->reset(Zend_Db_Select::ORDER);
    $countSelect->reset(Zend_Db_Select::LIMIT_COUNT);
    $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET);
    $countSelect->columns('datediff(main_table.support_end_date,current_date) AS days');

    $countSelect->columns('COUNT(*)');

    return $countSelect;
    }

My issues are

1) Filter on days is not pulling proper records
2) Count on the grid is showing incorrect

I have refferred below issues but no luck
How to add dynamic field in magento collection?

Issue using "having" in Magento collection

Could any one help in sorting this out, where iam going wrong


texts:
I'm trying to remove a product from an order, but my code is not working

$backOrdersIds = array();
        foreach ($this->getQuote()->getAllVisibleItems() as $item) {
            $oldQty = (int)$item->getProduct()->getStockItem()->getQty();
            $qtyOrdered = (int)$item->getQty();
            $differenceQty = $oldQty - $qtyOrdered;

            //remove backorder items from Quote
            if($differenceQty <= 0 ){
                $backOrdersIds[] = array(
                    'productId' => $item->getProductId(),
                    'qty' => $qtyOrdered
                );

                $item->delete();
                $this->getQuote()->save();
            }
        }

        foreach ($this->getQuote()->getAllVisibleItems() as $item) {
            var_dump($item->getProductId());
        }

 var_dump($item->getProductId());

still returns me all the products, even those that I deleted

How to remove the product from the order?


texts:
I want to get zipcode in sales->order->addressEdit using the event .

it's working fine.

Event.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="admin_sales_order_address_update">
        <observer name="verify_cod" instance="Xxx\Sales\Pincode" />
    </event>
</config>

But I want to the observer before addressSave controller execution ...
I also trying..

controller_action_predispatch_sales_order_addressSave

My page not redirect to address page...

please tell me how to do it.


texts:
Is it possible to find sales by a particular coupon code?

OR

Is it possible to read orders on which a particular coupon code is applied?

I wrote a script earlier to filter orders on which discounts were applied?

$from_date = date("Y-m-d", strtotime($_REQUEST['from_date']));
$to_date = date("Y-m-d", strtotime($_REQUEST['to_date']));

$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('created_at', array('from'=>$from_date, 'to'=>$to_date))
    ->addAttributeToFilter('status', array('eq' => Mage_Sales_Model_Order::STATE_COMPLETE));

$orders->addFieldToFilter('base_discount_amount', array('lt' => 0));

Thanks


texts: Magento 2 - extend core module translation i18n for a very specific area

texts:
Magento 2 translation problem (my locale is set to en_US):

I want to change the "Email" label on the Contact Us page to "Email Address:". However, I DO NOT WANT the "Email" label changed anywhere else.

The Contact Us page URL is https://[your m2 site]/contact/
One of the form entry fields is Email. The label translation is "Email".
When you examine vendor/magento/module-contact/i18n/en_US.csv I can see Email, Email in there. Obviously, I can't change it here.

We also have "Email" listed in other areas like vendor/magento/module-customer/i18n/en_US.csv. For example, when you browse to the customer account login page you will see it uses the translation from this file. That's fine. I don't want that to change.

So how can I use/extend Magento 2 to help me change JUST the Contact Us page "Email" label via i18n translations?

If I create a Storefront Inline Translation that's a global change across the whole site (i.e. "Email" label changes on all pages). No good.
If I create a language pack and store the csv file under app/i18n/[THEME]/[locale]/... the change in there is global too. No good.
If I create a an i18n csv file under our theme i.e. app/design/frontend/[THEME]/default/i18n/en_US.csv it changes all translations across the site. No good.

So how can I pinpoint my change without having to interfere with vendor/magento?

When reading the guides zooming in on language packages (http://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-i18n.html) I tried following the steps there.

When I ran the command

bin/magento i18n:pack /var/www/html/magento2/xx_YY.csv -d xx_YY

it created new xx_YY.csv files across all vendor/magento/ modules that I made reference to in Step 1. Is this correct? For example, I can now see:
vendor/magento/module-contact/i18n/xx_YY.csv file.

If I now register this language pack maybe that is the only way to fix it? It doesn't feel right.

I also tried creating an app/design/frontend/[THEME]/default/Magento_Contact/i18n folder with my en_US.csv file in there. No joy either.

Thanks,
Tadhg


texts: How to get price for configurable product

texts:
I have configurable products like

I created observer and I got the price

Default price is for 1kg but customer can change the weight and flavor.

When customer changes weight and flavor price changes.

like

I created observer in that I have code like

public function saveProductMrpInOrder(Varien_Event_Observer $observer) {
        $order = $observer->getEvent()->getOrder();
        foreach($order->getAllItems() as $item) {
            $price = Mage::getModel('catalog/product')->load($item->getId())->getPrice();
            $item->setProductMrp($price);
        }
      return $this;
    }

    public function saveProductMrpInInvoice(Varien_Event_Observer $observer) {
        $invoice = $observer->getEvent()->getInvoice();
        foreach($invoice->getAllItems() as $item) {
            $price = Mage::getModel('catalog/product')->load($item->getProductId())->getPrice();
            $item->setProductMrp($price);
        }
      return $this;
    }

    public function saveProductMrpInShipment(Varien_Event_Observer $observer)
{
        $shipment = $observer->getEvent()->getShipment();
        foreach($shipment->getAllItems() as $item) {
            $product = Mage::getModel('catalog/product')->load($item->getProductId());
            $price = $product->getPrice();
            $item->product_mrp = $price;
        }
    }

But in that I am getting default price which is for 1kg

But I want price for product according to attributes selected

How can I get that price.

Hope you understand.


texts: Put thumbnail highlighter to the rightmost image

texts:
On Product page, the image highlighter is always on the first image on the left by default.

I want to shift it to rightmost image by default.


texts: Set group id is equal to 2 for wholesale customer registration in Magento 2

texts:
Hello everyone I want to set group_id = 2 for wholesale customer registration.
I have to override the registration form in view/registration.phtml
and also written

<input type="hidden" name="group_id" id="group_id" value="2" />

I have also created the observer

  Magneto\WholesaleCustomer\Observer\Customer\RegisterSuccess.php

<?php

 namespace Magneto\WholesaleCustomer\Observer\Customer;

 use Magento\Customer\Api\CustomerRepositoryInterface;

 class RegisterSuccess implements
\Magento\Framework\Event\ObserverInterface {

 /**
 * @var CustomerRepositoryInterface
 */
 //added by me
private $customerRepository;

public function __construct(
    \Magento\Framework\App\RequestInterface $request,
     CustomerRepositoryInterface $customerRepository
    )
{
    $this->_request = $request;
    $this->customerRepository = $customerRepository;
}
//ends here
public function execute(
    \Magento\Framework\Event\Observer $observer
){

    $id = $observer->getEvent()->getCustomer()->getId();
    $customer = $this->customerRepository->getById($id);

     $group_id = $this->_request->getParam('group_id');

    $customer->setGroupId($group_id);

    $this->customerRepository->save($customer);

}
}

But the group id is coming 1 in the database I want to set it as 2 in database.


texts: Improving Magento search results (either via extension or free)

texts:
I'm trying to get search working on my Magento installation (200,000SKUs); we are wholesale so most products are just an SKU.

Of course with Magento you can type in part of the SKU and a bunch of results will come up that have absolutely nothing to do with what was typed in (?) seemingly regardless of how I have the search feature set up.

Does anyone have suggestions for an extension that won't break the bank or some form of changing settings; I've never had a search feature return such arbitrary results before.

I've researched improving it within Magento, but regardless of settings it always returns the same results. Plugins range in price from free (I tried a free one which did nothing) up to hundreds of dollars.

Thanks.

EDIT: To give you an example we have a product titled 14BL and even when searching for 14BL the obvious result (i.e. 14BL) will not show up even in the first page of results. What will show are a bunch of results that have nothing to do with the original search term (i.e. searching for 14BL the first 5 results are AD, 14SBNJ, BCAD, 18INLBJP, 14IND)

Also worth mentioning is that the website is focused on a large number of products for wholesale purposes (i.e. low traffic/private website with specialised search terms so paying large monthly fees for search is unfeasible).


texts: Problem with Multiple Store in Magento 1.9

texts:
I am trying to setup multi store in Magento 1.9.2.3, and here is what I have done so far (in the scenario I am trying to create another store for France and call it "FR"):

1) Creating a new root Catalog,

2) Creating a new Website/Store/StoreView in System >> Manage Stores

3) Creating a new directory called "fr" in magento root folder and I have copied "Index.php" and ".htaccess" file from magento root to "fr" folder.

4) I have edited the "index.php" file inside "fr" folder from

$mageFilename = MAGENTO_ROOT . '/app/Mage.php';

TO

$mageFilename = '../app/Mage.php';

5) and I have added below code into the ".htaccess" of "fr" folder:

SetEnvIf Host .*base.* MAGE_RUN_CODE="base";

SetEnvIf Host .*magento_site_2.* MAGE_RUN_TYPE="fr";

I have also set the "Auto-redirect to Base URL" to disabled in the admin panel, and set the "secure" and "Not-secure" base url for "fr" store accordingly.

The Problem is, when I try to access the new store by going to www.example.com/fr/, I can see the exact same website with all the products and categories that are available in www.example.com. It does not feel like a new empty store.


texts: Magento 2 - Open dropdown on mouse hover

texts: How can I make the dropdown Sort By to open on when putting the mouse over it instead click on it?


texts: i am using Magento website with around 200 Website and each website having three storeview. But products data only available in Main website with  3 store views. the problem i am facing now soon some on refresh the cache server completely hangs. so i am trying to know from where i can increase cache time so it not expires or from where i can disable auto refresh cache option please help me


texts:
All emails are not working. My cron settings is below.

I have tried running it manually by this command

php - f c:\xampp\magento\cron.php

No error or exception is generated in magento and xampp server log file

Need Help.

Thank you


texts: Only One Product and Product-view on frontsite

texts:
I would like to use Magento to sell only one Product with multiple product Attributes in my Store. So i want my ONLY product on the start site of the Magento Store with some Product Attribute Dropboxes. I ve seen that this is possible on sites like: www.sita-shop.de

you can see this is a magento theme customized and there is just 1 product and its on the start site of magento store.

would be very nice if anyone knows how to handle this and would help me.

thanks !


texts: Purchaseorder method payment dont' write on database

texts: When I shop at my store and using purchaseorder payment method, what happens is that sometimes Magento writes the data in the database and sometimes does not write. I do not know why this is happening. I'm using fake credit cards to do tests. Can anyone help me understand?


texts:
I have this code that I have made. My aim is to delete products whose SKU is in csv

require_once '../app/Mage.php';
Mage :: app("default") -> setCurrentStore( Mage_Core_Model_App::ADMIN_STORE_ID );
$skuAll =array();
$file_handle = fopen("skus.csv", "r");
while (!feof($file_handle) ) {
    $line_of_text = fgetcsv($file_handle, 1024);
    $allSku = $line_of_text[0];
}
$products = Mage::getResourceModel('catalog/product_collection')
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('sku', array('in' => $allSku))
    ->load();
if(is_array($products))
{
    foreach ($products as $key => $pId)
    {
        try
        {
            $product = Mage::getModel('catalog/product')->load($pId)->delete();
            echo "successfully deleted product with ID: ". $pId ."
";
        }
        catch (Exception $e)
        {
            echo "Could not delete product with ID: ". $pId ."
";
        }
    }
}

but its not working. Any help will be appreciated. I am using magento 1.7


texts: how to fix conflict between 2 extensions

texts:
Edit

I found the reason , i am using this extension : https://github.com/organicinternet/magento-configurable-simpfor that reason its not displaying configurable product in cart page.

but i need this extension, please help me how to fix this without disable the plugin

Edit end

we are using custom shipping method in our site....

we have a configurable products with associated simple products

we have "Add to cart" & "Buy Now Button" in product view page

please visit here

when we add the product to cart through "ADD TO CART" button, its adding both Configurable product and its associate product :

[![enter image description here][1]][1]

when we add the product to cart through "Buy Now button" button, its adding only associate product :

[![enter image description here][2]][2]

we created attribute "shipping charge" and entered the shipping prices there.

we were using this code Before for shipping charges :

$mpshippingcharge = 0;
 $localDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/local_shipping_distance');
 $regionalDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/regional_shipping_distance');
 $stateDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/state_shipping_distance');

Configurable product shipping price = 40,
Associated Simple product shipping price = 20

1)If we click on "Add to cart" we were getting shipping charges as "Total shipping charges= configurable product shipping price [40] + Simple product shipping price [20] =60 as total shipping charge"

2)If we click on "Buy Now" button we were getting shipping charges as "Total shipping charges= only Simple product shipping price [20] =20 as total shipping charge"

In both cases, what we wanted is , "Total shipping charges= configurable product shipping price [40]" , so we used this code :

if (Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($proid))
 {
  continue;
 }
 $mpshippingcharge = 0;
 $localDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/local_shipping_distance');
 $regionalDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/regional_shipping_distance');
 $stateDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/state_shipping_distance');

1)If we click on "Add to cart" we were getting shipping charges as "Total shipping charges= configurable product shipping price [40]" This is perfect.

2) But If we click on "Buy Now" button we were getting shipping charges as "Total shipping charges= 0[zero]" .

But we want the same result as ADD TO CART button. = > This is the Problem

If we use following code, than "Total Shipping charges = Simple products shipping price" for both Add to cart & buy now buttons.

if ($item->getHasChildren()){
continue;
 }
$mpshippingcharge = 0;
$localDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/local_shipping_distance');
$regionalDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/regional_shipping_distance');
$stateDistance = Mage::getStoreConfig('marketplace/mpperproductshipping/state_shipping_distance');

sir, please let me know if you need any information in FTP

template path hint : here

i am using following code to display "BUY NOW" button.

app/design/frontend/default/default/template/mpassignproduct/catalog/product/view/addtocart.phtml

 <?php if($assignPro['assignCount']): ?>
            <?php if($assignPro['sellerqty'] > 0): ?>

                <button type="button" title="<?php echo $buttonTitle ?>" id="product-addtocart-button" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><?php echo $buttonTitle ?></button>

               <button type="button" onclick="jQuery('#buy_


texts: Imported products and categories system urls return 404

texts:
We are setting up import of products and categories from suppliers XMLs.
The idea is to have it automatic and we have successfully imported products and automatically generated categories using this component:

https://www.wyomind.com/magento2/mass-product-update-import-magento.html#documentation
- I can fully recommend it - their support is fast and great! :)

/end of commercial/

However I have noticed that I cannot access my products directly like:
www.domain.com/catalog/category/id/123 or www.domain.com/catalog/category/view/id/123.
The same is with categories.

I know that URL Rewrites exists but as far as I understand they are so that I can rewrite "system urls" (like the ones above) into SEO friendly ones. In order for it to work "system url" should be working.. right?

Am I missing a step here?


texts:
Recently I received the mail from google saying Breadcrumbs issues detected.
Warning: data-vocabulary.org schema deprecated.
My question is: Can you help me with transforming the old data-vocabulary into schema.org?
Thanks!
Data-vocabulary code:

    <?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
        <?php if($_crumbInfo['link']): ?>
            <li class="<?php echo $_crumbName ?>" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">

           <a href="<?php echo $_crumbInfo['link'] ?>" title="<?php echo $this->escapeHtml($_crumbInfo['title']) ?>" itemprop="url"><?php echo $this->escapeHtml($_crumbInfo['label']) ?>

        <?php elseif($_crumbInfo['last']): ?>
            <li class="<?php echo $_crumbName ?>">
                <?php echo $this->escapeHtml($_crumbInfo['label']) ?>
        <?php else: ?>
            <li class="<?php echo $_crumbName ?>">
                <?php echo $this->escapeHtml($_crumbInfo['label']) ?>
        <?php endif; ?>

        <?php if(!$_crumbInfo['last']): ?>

        <?php endif; ?>

    <?php endforeach; ?>


texts:
I have been trying to modify the sidebar of One Page Checkout to make it so that the subtotal, tax, discount codes, and grand total information display before entering your credit card number.  The reason I want to do this is we have a rewards program in which we give out a decent dollar amount promo codes and we are always getting calls because our customers are afraid that the code is invalid once they goto checkout because it's not displayed until they enter their payment information.

I have dissected our cart and have found the following. (attaching images to help get a visual).

Pre-payment-information in OPC you see this:

And the code in our checkout.xml which displays this is:

<block type="checkout/cart_sidebar" name="cart_sidebar_right" as="topCartRight" template="checkout/onepage/sidebar.phtml">
                <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/sidebar/default.phtml</template></action>
                <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/sidebar/default.phtml</template></action>
                <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/sidebar/default.phtml</template></action>
                <block type="core/text_list" name="topCart.extra_actions" as="extra_actions" translate="label" module="checkout">
                    My Cart Extra Actions
                </block>
            </block>

And Post-payment-information in OPC you see this:

And the code within our XML that displays that is:

<block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">
        <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/review/item.phtml</template></action>
        <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/review/item.phtml</template></action>
        <block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
        <block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before" translate="label">
            Items Before
        </block>
        <block type="core/text_list" name="checkout.onepage.review.info.items.after" as="items_after" translate="label">
            Items After
        </block>
        <block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
        <block type="core/template" name="checkout.onepage.review.button" as="button" template="checkout/onepage/review/button.phtml"/>
    </block>

Is there anyway to modify our cart to display the information in Post-Payment-info to display pre-payment-info?  I have spent countless hours on this and I am pretty sure it's not impossible, but I have lost direction.

Any help is greatly appreciated as always!


texts: category url rewrite to cms page or other link Magento 2

texts:
i have created a category named blog which has url key blog.html to appear on main menu.
And now i have a blog page at <site-url>/blog

I want to redirect blog.html [Category URL] to /blog

What i tried :

via url rewrite [Backend > Marketing > URL Rewrites]. Here blog.html is redirected to catalog/category/view/id/5.

My intenstion was to create a url rewrite blog.html to /blog.
now when i try to create such redirect(custom type) it says "Request Path for Specified Store already exists."
I stuck here and couldn't create the desired redirect.

Then i tried with htaccess
Inside <IfModule mod_rewrite.c> i added Redirect 301 /blog.html http://www.mysiteurl.com/blog where RewriteEngine is on

and didn't get the luck either way.


texts: Add Checkbox input with required validation

texts:
I want to add a checkbox with a required field.

My code is :

<div>
    <input class="input required-entry" type="checkbox" id="check" name="check" value="1" data-validate="{required:true, 'validate-one-required-by-name':true}" />  I agree to the Terms and Conditions.
</div>

But it's not working.

Thank you


texts: How to create ACL for customer user in magento 2?

texts:
I have a customer with custom attribute as merchant. I want to let that customer to see only my custom module features.

How can I restrict a user to some custom features ?

Edit:

Actually I have created custom APIs to buy giftcodes as merchant (customer). I can test these APIs in Magento Swagger UI with customer token. But when I open swagger documentation I can see all custom APIs with that customer token. I am looking a way by which I could show the merchant(customer) only the custom APIs related to giftcode.

There is one custom module responsible for selling giftcodes. How can I create ACL to show a customer

  where customer->isMerchant is TRUE


texts:
I've been working on a Magento 2.2
and someone has run the "php bin/magento app:config:dump" command,
so, according to this documentation , several backend configuration are locked (ie. the input are disabled).

The documentation says :

  In 2.2 and later, you cannot delete the config.php file to regenerate it. You can only edit the file to change or remove a value. This file includes more information than just configuration values.

So I assume that I can only delete the entry one by one..... I cannot find any piece of documentation about how to do it? Which is the command?


texts:
It would be helpful if someone could clarify what are the different indexation mode in Magento2 for Solr search.

What are the difference, advantages and disadvantages of different indexation mode

Partial commit
Full commit
Engine auto commit


texts: Magento 2 : Use of echo language construct is discouraged

texts:
i had develop magento 2 extension
and i have use ajax call to my controller for getting some data.
but coding standard provide me some error

my controller code is ......

public function execute()
{
    echo $mediaUrl.'cs/test/'.$file.$extension;
}

i had use this code for js

function getFileUrl() {
    jQuery.ajax({
        method: "POST",
        url: "<?php  echo $block->getUrl('modulename/index/index'); ?>",
        data:{itemId:jQuery('input[name=item]').val(),data:jQuery('#file').html() }
    }).done(function(data) {
        jQuery('#file').val(data);
    });
}

if have any solution pleas provide it.


texts: totals sort of custom added row in my account order view

texts:
I have problem with sort custom added row in totals.

I successfully sort new row in cart and checkout page with this in my moduele config.xml

   <default>
        <sales>
            <totals_sort>
                <rowtotal>20</rowtotal>
            </totals_sort>
        </sales>
  </default>

Also with success sort new row in pdf invoice with tag <sort_order> in my module config.xml

    <pdf>
    <totals>
      <rowtotal translate="title">
        <title>Ukupno s popustom</title>
        <source_field>rowtot_alamount</source_field>
        <model>Devpassion_Rowtotal_Model_Pdf_Total_Totalpdf</model>
        <font_size>7</font_size>
        <display_zero>0</display_zero>
        <sort_order>300</sort_order>
      </rowtotal>
    </totals>
</pdf>

I don't have idea how to sort this new row in My orders view and email order view.


texts:
I have a task to make an api for Magento using it's SOAP or REST implementation.

I've read a lot about both services, also have experience with them. But not in high-loaded projects.

The task of this service will give some extra information to client via SOAP or REST. I've configured both and everything is ok.

BUT, the questions is what would be better if I have 100 clients calling my service per second, 200, 500 and so on?

I know about SOAP overhead, but also if I use REST I need to use also oAuth, so what will fall down first?

Any experience in that?


texts: I want to change attributes in CSV file also simultaneously when change in attributes from Admin grid

texts:
<?php
require __DIR__ . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$_objectManager = $bootstrap->getObjectManager();
$state = $_objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');
$registry = $_objectManager->get('Magento\Framework\Registry');
$registry->register('isSecureArea', true);
$productRepository = $_objectManager->get('Magento\Catalog\Model\ProductRepository');

$stockRegistry = $_objectManager->get('Magento\CatalogInventory\Api\StockRegistryInterface');
$csv = "export.csv";
$store_id = 1;

if(!is_file($csv))
{
    $fp = fopen("export.csv","w+");
    $collection = $_objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory')->create()->addStoreFilter($store_id)->addAttributeToFilter('type_id', 'simple')->addAttributeToSelect(array('sku','price','qty'));
    foreach ($collection as $product)
    {
        $data = array();

        $data[] = $product->getSku();
        $data[] = $product->getPrice();
        $data[] = $product->getQty();

        fputcsv($fp, $data);
    }
    fclose($fp);
}
else
{
    if (!empty($argv) && sizeof($argv) > 1)
    {
        $csv = $argv[1];
    }
    if (($handle = fopen($csv, "r")) !== FALSE)
    {
        while (($row = fgetcsv($handle, "\t")) !== FALSE)
        {

            $num = count($row);
            if ($num < 1)
             {
                continue;
             }
            $sku = trim($row[0]);

            if($num < 2)
            {
                echo "Skipping: " . $sku . " not enough fields\n";
                continue;
            }
             $price = trim($row[1]);
            $qty = trim($row[2]);
            try
             {
                $product = $productRepository->get($sku);
             }
            catch (\Exception $e)
             {
                echo "Error:  Invalid SKU, ".$sku."\n";
                continue;
             }

            if ($product->getPrice() != $price)
            {
                $product->setPrice($price);
                $product->save();
            }
            try
            {
                $stockItem = $stockRegistry->getStockItemBySku($sku);
            }
            catch (\Exception $e)
             {
                echo "Error:  Invalid stock SKU, ".$sku."\n";
                continue;
            }

            if ($stockItem->getQty() != $qty)
             {
                $stockItem->setQty($qty);
                if ($qty > 0)
                {
                    $stockItem->setIsInStock(1);
                }
                $stockRegistry->updateStockItemBySku($sku, $stockItem);
            }
        }
        fclose($handle);
    }

}


texts: How can i add two or more text box on same row. In magento 2

texts:
I want to add two textboxes on single row, how can i achieve this using block classes in magento 2. I want this on admin side.

Here is the code

          $fieldset->addField(
            'option_1',
            'text',
            [
                'name' => 'option_1',
                'label' => __('Option 1'),
                'class' => 'txt-type',
                'title' => __('Option'),
                'required' => true,
                'maxlength' => '50',
                'container_id' => 'some_row'
            ]
        );

        $fieldset->addField(
            'option_2',
            'text',
            [
                'name' => 'option_2',
                'label' => __('Option 2'),
                'class' => 'txt-type',
                'title' => __('Option'),
                'required' => true,
                'note' => '',
                'container_id' => 'some_row'
            ]
        );


texts: Magento 2 Auto-remove empty categories from menu?

texts:
I am using Magento 2.3.1 and the pearl theme. My site has many different categories and I wanted to know if there is a way to have magento automatically remove  categories that don't have product in them from the menu. I don't need them to be "disabled", just not visible.

Preferably also by level, as I use some of the root categories for other things besides products (due to brand licensing). I have looked at this question:
here. However, that looks like it's Magento 1.7 and it also seems like a lot of work for something like this.


texts: Specific view page for products (product info) from specific category in Magento 1.9

texts:
We devided all the products into two categories:

"Main products"
"Accessories"

All listed products from the category "Main products" are opened with our custom template: catalog/product/view_main_producs.phtml

Here it comes the tricky part :)

All products from the category "Accessories" needs to be opened with different custom template catalog/product/view_accessories.phtml, because the products from this category have different attributes.

In some way we managed (partly) to acchive this with the following lines of code:

<reference name="product.info">
<action method="setTemplate"> <template>catalog/product/view_accessories.phtml</template></action>
</reference>

We inserted the above code into "Accessories" category Custom Design -> Custom Layout Update

With the above code we managed to open products from category "Accessories" into on our custom view_accessories.phtml template!

Here is what is the problem. Above code only works if a person came to our web site through the links on our web site.

Now we have two issues:

If person come to our web site and search for accessories products (search toolbar), the product will not be opened in view_accessories.phtml template!
If person click on the products while searching for it on google, bing (SEO search), the product will not be opend in "view_accessories.phtml"!

Our question is: how to achieve for all products from "accessories" category to be opened in "view_acccessories.phtml" - no matter how come the person access the link?

Thanks in advenced :)


texts: When cloning existing site locally I get the following error "...properties already exists in the selected store."

texts:
When cloning a site for local development I get the following error:

a:5:{i:0;s:223:"Error in file: "/Applications/apache2/htdocs/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php" - A block identifier with the same properties already exists in the selected store.";i:1;s:1100:"#0 /Applications/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')

Im using a MAMP stack. The existing database was imported and connect via local.xml.

I cant edit core. Why is this error coming up? Conflict between wanting to setup new install vs using existing db?


texts: Magento 2.3 — Invalid Form Key. Please refresh the page

texts: Getting Invalid Form Key. Please refresh the page error not able to do any action after upgrade of Magento 2.2.5 to Magento 2.3.


texts: Admin form using same Action Method for both?

texts:
Magento 1.7

In the Admin Panel under System-->Permissions-->Users

When I click on a User OR "Add New User" and I right click and inspect element I see the following for both:

They both share the same Action Url which doesn't make sense shouldn't me clicking on a User have a form with an action of http://makeyourjewel.com/index.php/power/permissions_user/edit/ instead?

This is driving me insane because I don't know where to change this.  This code has been like this since I started working and I'm currently looking at Magento default base files to compare, please help!


texts: setup:static-content:deploy needs to run very frequently

texts:
Why does my css keep breaking and none of the clicks works in Magento2 frequently, even without any changes done in any of xml files.

Everytime I need to run php bin/magento setup:static-content:deploy, it is very frustrating.

What can I do about it?


texts: Magento2 : Custom product attribute not filtering results in layered navigation

texts:
I have a custom product attribute name 'gg_availability' on my Magento 2 web store.
I've set it to appear in the layered navigation filter on the product list page. Any by I've set, I mean it was set and put into production months before I took on my role.

Selecting it adds the proper URL parameters and sets the left-hand filter appropriately. But, no results have been filtered out.
See below:

Any idea why? Is this a bug? Not a single preorder available item got filtered in or out.
Any help would be appreciated.
Thanks in advance..!
EDIT: Caches have been cleared, the attribute scope is global, the indexers have been reindexed, and all products have this attribute set.


texts: Create Product with image using REST API

texts:
I'm trying to create a product with an image using the REST API in Magento 2 but I get always 400 Error Code saying it's a bad request. Trying it without an image works but if I put the entry "media_gallery_entries" it doesn't work.

The encoded json looks like this:

{
"product": {
"sku": "KT909",
"name": "PrintaMent PURE 2.85 mm - Schwarz - 0,5 kg",
"price": 2.5,
"status": 1,
"type_id": "simple",
"attribute_set_id": 4,
"weight": 0.5,
"extension_attributes": {
  "website_ids": [
    1
  ],
  "category_links": [
    {
      "position": 2,
      "category_id": "3"
    }
  ],
  "stock_item": {
    "qty": 99
  }
},
"media_gallery_entries": [
  {
    "position": 2,
    "media_type": "image",
    "label": "test",
    "disabled": false,
    "content": {
      "base64_encoded_data": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
      "type": "image/jpeg",
      "name": "3D-Drucker.jpg"
    }
  }
]
},
"saveOptions": true
}


texts: how to migrate complete website from magento 1 to magento 2?

texts: Recently I'm trying to migrate our website from Magento1 to Magento 2. I want to move complete website, where we have lot of third party custom extensions


texts:
I have created a module in which admin can specify the date range and fixed shipping amount if any order is placed between the date range. Lets say calculated shipping is $100 and admin has specified that shipping amount should be $50, then difference between original shipping and specified shipping amount i.e $100 - $50 i.e $50 should be given as discount.

I have called an event sales_quote_collect_totals_after, where I am calling collectTotals function in my observer. In my observer I have calculated the discount amount and have set the discount amount on address.

But according to configuration settings, the total tax is applied on subtotal + shipping.

Lets say item total is $2000 and shipping total is $100, discount amount is $50, So grand total will be $2000 + $100 - $50 i.e $2050, and tax is about 20%. So tax amount should be $410, but calculated tax amount is appearing 20% of 2100 i.e $420 and grand total including tax is appearing $2050 + $420 i.e $2470 but It should be $2050 + $410 i.e $2460.

Can anyone please tell what I should do to recalculate Tax and Grand totals
including tax ?


texts: How to load currency block in controller

texts:
I have created multi-currency selector in header using following logic

Updated app/design/frontend/default/my_theme/layout/local.xml as per follow

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="header">
            <block type="directory/currency" name="my_currency_selector" template="currency/currency.phtml"/>
        </reference>
    </default>
</layout>

In app/design/frontend/default/my_theme/page/html/header.phtml added:

<?php echo $this->getChildHtml('my_currency_selector') ?>

Its works perfectly fine.

Now problem is that, I have ajax call on list page because of this I need to reload my_currency_selector in controller.
I used following code which return me breadcrumbs block html.
$breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')->toHtml();
But same code is not working for currency. I tried
$currency = $this->getLayout()->getBlock('my_currency_selector')->toHtml();

Please tell me What I am mising


texts: How to set custom price range in magento 1.9?

texts:
I want to show the price range Like this

Up to Rs 10000

From 10000 to 25000

From 25000 to 50000

From 50000 to 100000

From 100000 to 300000

Above 300000

How to implement this?


texts: Magento creating index.html files on root of hosting dir

texts:
My magento install creates many index.html files on root of web hosting dir (ie, outside public_html folder). Over one month created thousands of these files, taking up to 300MB of space. The files are incremental.

index.html index.html.1 etc

each one is about 50KB and the content is the content of the html of home page...

Is this sometithing to do with the cache system? How to turn off to avoid goid over quota of web space?

Cheers


texts: Magento redirects to cart page when using Belvg Gift Extension

texts:
I have a magento website that is using Belvg Gifts extension but when the extension is active ite redirects to cart page when you are filling information on the onepage checkout step.

I check the errors using firebug console  I get the following

POST http://www.floridawinestore.com/checkout/onepage/saveMethod/ 403 (Session Expired)  prototype.js:1530

I conctacted the developer of the extension but said it works well but even when I install it using default Magento template it does not work. I have also tested with sevaral other templates but the same thing.

Here is the extension

http://www.floridawinestore.com/Belvg_Gifts-v.1.0.0.zip

If someone can help solve fix this extension I'll greatly appreciate

Thanks


texts: How to add additional field to checkout payment (Magento 2)

texts:
I have a payment module for Magento 2 and I would need to add a new field to checkout fiels. To my understanding I can add the field to checkout_index_index.xml layout file, but I just can't get it right.

My layout file is currently

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="billing-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="payment" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="renders" xsi:type="array">
                                                        <!-- merge payment method renders here -->
                                                        <item name="children" xsi:type="array">
                                                            <item name="lindorff-payments" xsi:type="array">
                                                                <item name="component" xsi:type="string">Company_Mypayment/js/view/payment/mypaymentpayment</item>
                                                                <item name="methods" xsi:type="array">

                                                                     <item name="mypaymentpayment" xsi:type="array">
                                                                        <item name="isBillingAddressRequired" xsi:type="boolean">true</item>
                                                                    </item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</body>

I wish to keep all existing default payment address fields and add a new text field, but how?


texts: Hide Mini-Cart and Header-Account Dropdown When Click Outside of Those Sections

texts:
I am building a custom theme based on Magento 1.9 RWD.

How do I manage to hide/close the mini cart and header-account drop down by clicking anywhere outside of those sections ?

EDIT - 1

zhartaunik's answer helped me to resolve the issue. But I am now facing below issue.

If I click the language-switcher its stays open. Now when I click the mini cart and header-account, those drop-downs opens, but also the language-switcher still stays open! I want this one to close directly when another button is clicked? How do I get this done?


texts: How to correctly use "self" resource in Magento 2 webapi.xml

texts:
I have created some endpoints in a module that have a resource of "self"

When I call the request using a jQuery ($.post) I get an Not allowed to accesses resource "self". These requests are done on the onpage.phtml template.

According to the Magento 2 documentation "if a customer is logged in to the Magento storefront and the JavaScript widget invokes the self API, details for the logged-in customer are fetched". To note the customer IS logged in.

Note: I am not sending customer token. Do you need this? You can then make this request from anywhere if you do use a token. Which breaks the statement that only AJAX calls can get a "self" resource.

Any help is welcome.


texts: Error in installation of data migration tool for m2

texts:
I stuck on installation of data migration tool for m2. I am doing this in my localhost. i am using following commands to install data migration tool

composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool
composer require magento/data-migration-tool:2.1.2

I also tried

composer config repositories.magento composer https://repo.magento.com
composer require magento/data-migration-tool:2.1.2

i tried to resolve this query from searching on google but i didn't get answer
I am getting error Your php version 7.0.0 does not satisfy that requirenent although my php version is 7.0.8. please consider screenshots

Error:

PHP Version:


texts: Magento 2 - Field Depedency does not hides label of field when field has "after_element_html" in its $config?

texts:
As shown in this two images, after selecting the HIDE option from the select, the field OP does not hide entirely. I noticed that it only happens when the field OP does have a "after_element_html" in its $config.

This is an expected behaivior?


texts: Could not save product - TRIGGER command denied to user

texts:
Could not save product in Magento 2.1.9 after copying the database from another Magento 2.1.9 shop and changing the mysql user (f.e. if you copy your develop database to production server, the credentials do necessarily not match).

Error while saving a product:
SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user olduser@host ...


texts: Catalog search: Always show configurable instead of simple product in search result

texts:
I have to modify the catalog search to only show the configurable parent product of a simple product in the search result.

It should work like this:

Simple Product SKU: 123.123
Configurable Product SKU: 123.100-X
Search "123.123"

Result: Product 123.100-X is displayed.

I'm pretty sure I have to override the function: prepareProductCollection in app/code/core/Mage/CatalogSearch/Model/Layer.php

But I'm stuck with this.

As a second step, I want to preselect the configurable options of the showed configurable product based on the searched simple product, if only one exact result is returned.

For this I would redirect to the product view page like described in this thread:
Catalog Search: If only one result, show product view page insted of list view

And use this function to get the attribute value to select:

private function getProductUrlWithAttributes($product, $storeId) {

$url = $product->setStoreId($storeId)->getProductUrl();
$urlHash = array();
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());

if(isset($parentIds[0])) {

  $parent = Mage::getModel('catalog/product')->load($parentIds[0]);
  $url = $parent->setStoreId($storeId)->getProductUrl();
  $attrs = $parent->getTypeInstance(true)->getConfigurableAttributes($parent);

  foreach ($attrs as $attribute) {
    $productAttribute   = $attribute->getProductAttribute();
    $productAttributeId = $productAttribute->getId();

    if($attributeValue = $product->getData($productAttribute->getAttributeCode())) {
      $urlHash[$productAttributeId] = $attributeValue;
    }
  }
}

if(count($urlHash) > 0) {
  $url .= '#'.http_build_query($urlHash, null, ',');
}

return substr($url, 0, 2000);
}

(Source: http://www.snip2code.com/Snippet/171609/gets-a-Magento-parent-product-url-with-h)

I would really appreciate any help, I don't know how to continue with this.


texts: How does one disable the suggested terms in Magento 1.9.3.3

texts:
I have tried disabling the Magento suggested terms for their search function by first turning of autocomplete in the backend, but this doesn't seem to work. Now I'm looking for another way to make this happen or to make sure that search terms entered by customers do not get added with use suggested terms by default.

Any help not involving editing the core code would be greatly appreciated.


texts:
I have a strange problem with my Magento 2.3.4 installation.

A product on a category page is showing an image not uploaded for the product.

The image shown below belongs to a different product!!!

Image shown does not appear in admin.

Have tried flushing cache, reindexing and running catalog:images:resize but with no change, still showing wrong image.

Also the same image is appearing in the new products widget on front-page.

Does anyone know what is going on?


texts: How to remove "special pricing" on Wishlist and Product Page

texts: When I add special pricing for a customer group... I would like it to just show the current price it is at, for example $3.95 in the attached image. I don't want it to show the crossed off "regular price" and new "SPECIAL PRICE". Anyone know how to do that? It seems to show this on the frontend only in the Product Page itself and Wishlist. Thanks


texts: Where can I find details about APPSEC-1793 vulnerability fixed in SUPEE-10266?

texts:
SUPEE-10266 is out with a long list of fixed issues. The severest one to me is "APPSEC-1793: Potential file uploads solely protected by .htaccess", which is a RCE.

I'd like to find out more about the issue to better evaluate my deploy schedule. Is there any in-depth analysis of this specific vulnerability, with attack vectors and mitigation tips?


texts: Magento 2: How to use multiple fieldsets using uiComponents?

texts:
I want to have multiple fieldsets under the same tab using uiComponents.
There is something similar under Stores -> Attributes -> Product but it's created using an old deprecated method.

Is there a way to achieve this using uiComponents?

This is what I have until now:

<fieldset name="module_shipping_address">
    <settings>
        <label translate="true">Shipping Address</label>
    </settings>
    <field name="email" formElement="input">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">module_shipping</item>
                <item name="label" xsi:type="string" translate="true">Email</item>
            </item>
        </argument>
        <settings>
            <validation>
                <rule name="validate-email" xsi:type="boolean">true</rule>
                <rule name="required-entry" xsi:type="boolean">true</rule>
            </validation>
            <dataType>text</dataType>
            <visible>true</visible>
        </settings>
    </field>
</fieldset>

If I add a new fieldset a new tab will be created. Is there a way to achieve what I want using uiComponents?


texts: Magento 2.3 products to ship and submit shipment button missing

texts: From the magento2.3 admin panel when I go to orders->ship in the New Shipment page products that are to be shipped are not shown and am unable to ship. Anyone help me solve this issue.


texts: Overwrite function of Magento Core Class without having to develope extension

texts:
I try to overwrite a function from a core class without having to create an extra  extension for it.

I need to overwrite the function _loginPostRedirect() from Mage_Customer_AccountController to change the redirect behaviour.

The class is in app\code\core\Mage\Customer\controllers\AccountController.php

Im not sure about the fall-back way of magento, but I remember I readed that magento first looks in  app\code\local\ instead of app\code\core to find out if the file exists there and then app\code\local\Mage\Customer\controllers\AccountController.php is getting loaded instead of app\code\core\Mage\Customer\controllers\AccountController.php.

But I tried it and magento still loads the file from app\code\core.

How does it work?

Basically I just want to change one line at the very bottom:

    /**
     * Define target URL and redirect customer after logging in
     */
    protected function _loginPostRedirect()
    {
        $session = $this->_getSession();

        if (!$session->getBeforeAuthUrl() || $session->getBeforeAuthUrl() == Mage::getBaseUrl()) {
            // Set default URL to redirect customer to
            $session->setBeforeAuthUrl($this->_getHelper('customer')->getAccountUrl());
            // Redirect customer to the last page visited after logging in
            if ($session->isLoggedIn()) {
                if (!Mage::getStoreConfigFlag(
                    Mage_Customer_Helper_Data::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD
                )) {
                    $referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME);
                    if ($referer) {
                        // Rebuild referer URL to handle the case when SID was changed
                        $referer = $this->_getModel('core/url')
                            ->getRebuiltUrl( $this->_getHelper('core')->urlDecodeAndEscape($referer));
                        if ($this->_isUrlInternal($referer)) {
                            $session->setBeforeAuthUrl($referer);
                        }
                    }
                } else if ($session->getAfterAuthUrl()) {
                    $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
                }
            } else {
                $session->setBeforeAuthUrl( $this->_getHelper('customer')->getLoginUrl());
            }
        } else if ($session->getBeforeAuthUrl() ==  $this->_getHelper('customer')->getLogoutUrl()) {
            $session->setBeforeAuthUrl( $this->_getHelper('customer')->getDashboardUrl());
        } else {
            if (!$session->getAfterAuthUrl()) {
                $session->setAfterAuthUrl($session->getBeforeAuthUrl());
            }
            if ($session->isLoggedIn()) {
                $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
            }
        }
//        $this->_redirectUrl($session->getBeforeAuthUrl(true));
        $this->_redirectUrl("/customer/account");
    }


texts: Category ID not matching with current category

texts:
I'm displaying image of categories into my menu. It's working until the ID for the category is 10.

Pasted 10, the ID restart to 1, so my ID 11 is having the properties of the 1, like it's image (which I don't want do show).

Here's my topmenu.php

foreach ($children as $child) {
            if ($childLevel === 0 && $child->getData('is_parent_active') === false) {
                continue;
            }
            $categoryId = substr($child->getId(),-1);  // Get CATEGORY ID
            $category = $categoryFactory->create()->load($categoryId);
            $child->setLevel($childLevel);
            $child->setIsFirst($counter == 1);
            $child->setIsLast($counter == $childrenCount);
            $child->setPositionClass($itemPositionClassPrefix . $counter);

            $outermostClassCode = '';
            $outermostClass = $menuTree->getOutermostClass();

            if ($childLevel == 0 && $outermostClass) {
                $outermostClassCode = ' class="' . $outermostClass . '" ';
                $currentClass = $child->getClass();

                if (empty($currentClass)) {
                    $child->setClass($outermostClass);
                } else {
                    $child->setClass($currentClass . ' ' . $outermostClass);
                }
            }

            if (count($colBrakes) && $colBrakes[$counter]['colbrake']) {
                $html .= '

';
            }

            $html .= '
_getRenderedMenuItemAttributes($child) . '>';
            $html .= 'getUrl()  . '" ' . $outermostClassCode . '>'
                .''. $category->getId() .' - ' . $this->escapeHtml($child->getName())
                . 'getImageUrl() . '"/>'. $this->_addSubMenu(
                    $child,
                    $childLevel,
                    $childrenWrapClass,
                    $limit
                ) . '
';
            $itemPosition++;
            $counter++;
        }

How to change that to make my code work ?


texts: in custom homepage template images added only in newline (magento 1.9.4)

texts:
Following is the homepage.phtml

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2018 Magento, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Template for Mage_Page_Block_Html
 */
?>

<!DOCTYPE html>

 <html lang="<?php echo $this->getLang(); ?>" id="top" class="no-js">

<?php echo $this->getChildHtml('head') ?>

<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>

    <?php echo $this->getChildHtml('global_notices') ?>

        <?php echo $this->getChildHtml('header') ?>

                <?php echo $this->getChildHtml('breadcrumbs') ?>

                    <?php echo $this->getChildHtml('global_messages') ?>
                    <?php echo $this->getChildHtml('content') ?>

        <?php echo $this->getChildHtml('footer_before') ?>
        <?php echo $this->getChildHtml('footer') ?>
        <?php echo $this->getChildHtml('global_cookie_notice') ?>
        <?php echo $this->getChildHtml('before_body_end') ?>

<?php echo $this->getAbsoluteFooter() ?>

the following code adds 2 images as desired but on newlines

I want the images to appear next to each other


texts: Is this if-else-condition possible in layout XML?

texts:
I want to display two different CSS

<action method="addItem" ifconfig="module/general/enable">
    <type>js_css</type>
    <name>module/app.css</name>
</action>

In XML we use ifconfig but I want to add two different CSS files like this

if (marketplace/general/enable == 1) {
     css-1
 } else {
     css-2
 }

How can I do this?


texts: I want to develop a custom theme for Magento 2, but I can't find the default blank theme of Magento. The folder "/app/design/frontend/Magento" is empty. Shouldn't there be a "blank" directory? Can't find all the default templates...


texts: removing first and last name on customer/account

texts: I need to figure out how to remove displaying the customers first and last name on the customer/account page. I have figured out how to do this with the checkout process already.


texts: Set debugging phpStorm for magento application?

texts:
I'm new to Magento. I'm used to working in dot net, where you can place the debugger where you need, so that you can identify bugs and other issues.

So, now I am learning Magento with phpStorm. Please let me know how to set line by line debugging from my custom module?

thanks in advance.


texts: Remove button from customer admin form in Magento 2

texts:
I want to remove the Create Order button from the admin customer edit form and I don't know how to do this via a plugin or an event.

The button is added from Magento\Customer\Block\Adminhtml\Edit::_construct and I cannot write a plugin for a protected method.
Is there an event, or a public method that is called after the buttons are added and before the layout is rendered that I can use?


texts:
I am working on a site where our front end developers want to add CSS files to specific pages through the Admin (in effect, certain Admin driven pages will have special CSS). We are not using the built-in LESS setup that Magento has.

So far, they've tried the following (in Content > Pages > Edit Page):

This "works" in the sense that the css file is in the <head/> and gets loaded. The issue is that we also have this in our default_head_blocks.xml file:

When Magento combines all of the xml, the resulting css files are ordered as follows:

This causes the cascade to grab the CSS in an undesired order and the page doesn't display as we need. I've tried playing around with the <move/> XML action to no avail.

We've had little to no luck with finding a solution. I found this question, What is the proper way of positioning/ordering CSS files in Magento 2?, but the answer here is not an option at all.


texts: Unable to add to cart from new Arrivals and Best Sellers, Magento 1.9.3

texts:
Unable to add to cart from New Arrivals and Best Sellers from Home Page,

we did not add any new modules or any customization suddenly it is not working,

we are using single page checkout, it is redirecting to "THE SHOPPING CART IS CURRENTLY EMPTY"

from remaining all the places working fine.


texts: How to utilize product code with url-key for more effective urls?

texts:
Below is a typical Magento Product Url:

http://magesite.com/pretty-product-name

While this is a nice clean url, it seems kind of risky relying solely on a url-key. There's so many ways a url-key can get mangled (characters cut off, reformatted, etc) but ID's seem to stick around. How would you implement some sort of id in the url? It seems to me a lot of sites do this. (Like Below):

http://magesite.com/product/123/pretty-product-name
http://magesite.com/p/123/pretty-product-name

http://www.amazon.com/dp/B00DN3KHP4
http://www.amazon.com/dp/B00DN3KHP4/Some-Url-Title

So the following user scenarios could happen:

Browser Attempt: http://magesite.com/p/123/pretty-produc [No Url-Key Found] Site can use the product ID to 301 redirect to http://magesite.com/product/123/pretty-product-name

Browser Attempt: http://magesite.com/p/123 [No Url-Key Exists] Site can use the product ID to 301 redirect to http://magesite.com/product/123/pretty-product-name

Browser Attempt: http://magesite.com/p/123/old-product-description [No Url-Key Exists] Site can use the product ID to 301 redirect to http://magesite.com/product/123/pretty-product-name

Background

I'm new to Magento, using EE 1.13.. Our previous platform (Custom Coded) did the above and thought it was great.

Notes
The Amazon example I used lacks the redirect which I think it pretty powerful for SEO.


texts: How to update customer data faster and more efficiently

texts:
I am writing a script to add values to a custom attribute for 10 thousand customers. I have two questions here.

when we update custom attribute values for product, we can use:

$resource = $product->getResource();
$product->setData($attribute, $value);
$resource->saveAttribute($product,$attribute);

which is very fast.
But as for customer, it does not have getResource() method. The only way I know is:
    $this->_customerRepository->save($customer);
which is very very slow. so how can I update the customers values faster?
when I update these values in bulk, I wrote the script as followings, it was running fine at the start, but then throws exception:
(/chroot/home/.../html/vendor/magento/framework/Exception/FileSystemException.php): failed to open stream: Too many open files in /chroot/home/.../html/vendor/composer/ClassLoader.php on line 444
I Googled this problem and someone says it is relevant to the settings of sever. However, since we rent the server and have no authorization to change it, how should I modify my code and make it use less resources?

       protected function updateAttributes($customersListData,$output) {
          $time_start = microtime(true);
          $totalLength = sizeof($customersListData);
          foreach ($customersListData as $customerIndex => $singleCustomerData) {
            try {
              $id = $singleCustomerData['id'];
              $customer = $this->_customerRepository->getById($id);

              $arrayKeys = array_keys($singleCustomerData);
              array_shift($arrayKeys);
              foreach ($arrayKeys as $singleKey) {
                if (empty($singleCustomerData[$singleKey])) {
                  $singleCustomerData[$singleKey] = "";
                }
                $time_now = microtime(true);
                $time_used = $time_now - $time_start;
                $finished_records = (int)$customerIndex + 1;
                $output->writeln("Updating attribute: ".$singleCustomerData[$singleKey].". " .$finished_records ."/".$totalLength." done. will finsih in: ". round($time_used / $finished_records * ($totalLength - $finished_records), 0). "s.");
                $customer->setData($singleKey, $singleCustomerData[$singleKey]);
              }
              $this->_customerRepository->save($customer);
              unset($customer);
            } catch (\Exception $e) {
              $output->writeln($e->getMessage());
              continue;
            }
          }
        }


texts: Magento2 EE - Multi Language - CMS Page does not translated first time

texts:
I'm working on Magento Commerce cloud project which having two store views(English & Arabic)

While I'm trying to switch from English store view to Arabic store view from particular CMS page. It's not reflecting with translation. But it is showing applicable content while doing hard refresh.
As I marked that it is happening only on staging instance where fastly cache has been Activated.

Does fastly supporting for cms pages with multi-store view or not?

I'm unable to reproduce this issue into development instance even into private browser.


texts: How do I eliminate render blocking JavaScript and CSS in above fold content

texts:
I am trying to improve my Google Page Insight score and it states that I need to do the following;

Eliminate render-blocking JavaScript and CSS in above-the-fold content

Your page has 1 blocking script resources and 2 blocking CSS resources. This causes a delay in rendering your page.

None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML.

Remove render-blocking JavaScript

http://gbnet.giggleberries.netdna-cdn.com/…a/js/aeb20058a8567ed3acc857b2edcd8af2.js

Optimize CSS Delivery of the following:

http://gbnet.giggleberries.netdna-cdn.com/…css/d497d831cf1abb3dbc3960b0f3e9bcf7.css
http://fonts.googleapis.com/css?family=Open+Sans&subset=latin

Can anyone advise how I do this? Everything I look for on the internet refers to HTML sites and I have been informed that these solutions do not apply to a php site.

Thanks


texts: what is field name for image sort order in CSV to import product from dataflow profile?

texts:
I want to upload import bulk images in magento.

Each product has three images, so sort order of image is must while importing in bulk.

But after a lot googling i didn't find field name for image sort order.

(In case of API its equivalent is "position")

Anyone please tell me What is field name for image sort order in CSV imported from dataflow profile?


texts:
In my enterprise, I have a situation where my staging content is messed up for a product.
I can see the active staging content by going into Content > Content staging > Dashboard but it doesn't reflect in the product itself.
Obviously, because of this, staged content is not applied and not able to delete it either.
When saving the product it throws this error:

The update with the "xxx" ID doesn't exist. Verify the ID and try
again.

How do I clean up this? I don't want to delete the product. If I could delete the staged content (scheduled content).


texts: Why does Magento have a layout XML media_type meta tag which outputs nothing?

texts:
In the DevDocs, Magento details the possible meta tag names available to include in the head layout XML. The explanation for the media_type tag caught my eye:

  This tag will not render (see \Magento\Framework\View\Page\Config\Renderer for details)

Indeed, when checking the class mentioned, it looks like the media_type tag will not output anything:

case 'media_type':
    $metadataTemplate = false;
    break;

What is the reason for including this in both the documentation and in the code, if there is no output rendered?


texts: get requirejs-config.js to load declared cdn's for jquery

texts:
I have been trying to get the requirejs-config.js to load, but as of yet it will not.. I have followed http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/custom_js.html and put the file like,

/app/design/frontend/<vendor>/<theme>/requirejs-config.js

containing

(function() {
/**
 * WSU something
 */

var config = {
    "paths": {'jquery':'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js',
        'jquery/ui':'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js',
        'spin':'https://repo.wsu.edu/spine/1/spine.min.js?2015-16-12',
        'datatables':'//cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js'},
    map:{'*':{'jquery':'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js',
        'jquery/ui':'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js',
        'spin':'https://repo.wsu.edu/spine/1/spine.min.js?2015-16-12',
        'datatables':'//cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js'}}
};

require.config(config);
})();

NOTE that I started with

var config = {
    "paths": {'jquery':'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js',
        'jquery/ui':'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js',
        'spin':'https://repo.wsu.edu/spine/1/spine.min.js?2015-16-12',
        'datatables':'//cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js'},
    map:{'*':{'jquery':'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js',
        'jquery/ui':'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js',
        'spin':'https://repo.wsu.edu/spine/1/spine.min.js?2015-16-12',
        'datatables':'//cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js'}}
};

which is what the doc indicate but also doesn't work..

The issue is it never loads.  Just in case I have also run php bin/magento setup:static-content:deploy with not luck.

How do we get the new paths declared


texts: Magento 2: How to repurpose the admin product image uploader?

texts:
Using 2.1.3, I'd like to add an image uploader to a custom admin module I'm building.

I've gotten as far as copying vendor/magento/module-catalog/view/adminhtml/web/catalog/base-image-uploader.js to my module, renamed it and included it in my requirejs-config.js file - but it looks like it needs a specific x/magento-template to generate the uploader. (Ultimately I'll rework the ajax call to target a controller in my module as well as make additions to the success methods)

Does anyone have any tips on how to go about adding Magento 2's base image uploader to a custom module?


texts:
i have an attribute named manufacturer which contains my products brands. Like: Apple Co
and my brands images are stored in: media/wysiwyg/queldorei/shopper/brands. With names like: apple_co
Now i want to show my brands images in the product pages. and i want theme to be clickable. and head me to a page with all of those brands products.

i will be thankful if you experts help me


texts: How to reduce the size of logo in print order? Magento2

texts:
I have added below code in sales_order_print.xml

<body>
    <referenceBlock name="logo"  remove="true" />
    <block class="Magento\Theme\Block\Html\Header\Logo" name="print_logo">
        <arguments>
            <argument name="logo_img_width" xsi:type="number">147</argument>
            <argument name="logo_img_height" xsi:type="number">24</argument>
        </arguments>
    </block>
    <move element="print_logo" destination="page.main.title" before="-"/>
    <move element="copyright" destination="main"/>
</body>

But the logo can be very large, I want to reduce the height of logo so it can be show proper in print, I already give height size 24 but no luck, please help how can I do that?


texts: Magento 2 - website is not loading full in my server how i can fix this

texts:
Magento 2 -  when access my domain it's print like above image

i run

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

then i cleared cache but it's not working ...

how i can fix this???