texts: Magento2 Add Product API With Custom Attributes

texts:
I know how to call Add product API in magento2 by default. But here i want to add Option Names Like Maroon , Red Instead of values like 143 , 167 etc.
Here is our default Payload
{
  "product": {
    "sku": "MS-Dime-S",
    "name": "Dime Tee Small",
    "attribute_set_id": 9,
    "price": 25,
    "status": 1,
    "visibility": 1,
    "type_id": "simple",
    "weight": "0.6",
    "extension_attributes": {
        "category_links": [
            {
                "position": 0,
                "category_id": "11"
            },
            {
                "position": 1,
                "category_id": "12"
            },
            {
                "position": 2,
                "category_id": "16"
            }
        ],
        "stock_item": {
            "qty": "10",
            "is_in_stock": true
        }
    },
    "custom_attributes": [
        {
            "attribute_code": "description",
            "value": "The Dime Tee is soft, comfortable and durable. You will love the way you look in this tailored tee shirt."
        },
        {
            "attribute_code": "tax_class_id",
            "value": "2"
        },
        {
            "attribute_code": "material",
            "value": "148"
        },
        {
            "attribute_code": "pattern",
            "value": "196"
        },
        {
            "attribute_code": "color",
            "value": "52"
        },
        {
            "attribute_code": "size",
            "value": "168"
        }
    ]
  }
}

In this if you see SIZE attribute code , We are passing 168 as value. Where as in Magento2 If you upload them from CSV file you can mention like "Small " or "Medium" etc. In Magento2 API why it is not accepting Option Names Instead of Values.
Does any one have API calls which will accept same as CSV file name convention rather than default values of dropdown?
Thanks


texts:
Magento 2.2.7

Getting this error in the error_log and customer get's white screen when trying to login to site,

Fatal error: Uncaught Error: Call to a member function getValue() on null in
/home/website/public_html/vendor/magento/module-bundle/Model/Product/Type.php:338
Stack trace:
#0 /home/website/public_html/vendor/magento/module-catalog/Model/Product.php(1926): Magento\Bundle\Model\Product\Type->getWeight(Object(Magento\Catalog\Model\Product\Interceptor))
#1 /home/website/public_html/generated/code/Magento/Catalog/Model/Product/Interceptor.php(1259): Magento\Catalog\Model\Product->getWeight()
#2 /home/website/public_html/vendor/magento/module-quote/Model/Quote/Item.php(433): Magento\Catalog\Model\Product\Interceptor->getWeight()
#3 /home/website/public_html/generated/code/Magento/Quote/Model/Quote/Item/Interceptor.php(128): Magento\Quote\Model\Quote\Item->setProduct(Object(Magento\Catalog\Model\Product\Interceptor))
#4 /home/website/public_html/vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php(275): Magento\Quote\Model\Quote\Item\Interceptor->setProduct(Object(Magento\Catalog\Mode in /home/website/public_html/vendor/magento/module-bundle/Model/Product/Type.php on line 338

Any help would be appreciated. Not sure where this is coming from, all of the products have a weight set.


texts: Shopping Cart Rule: Buy 2 items, get 5% on 2nd; Buy 3 items, get 5% on 2nd + 10% on 3rd

texts:
I am trying to set up a shopping cart rule like this, but I am not able to think of the best solution. This is the scenario:

  I have a product X. If user buys 2 quantities of X, he should get 5%
  on the second X. If user buys 3 quantities of X, he should get 5% on
  the second X and 10% on the third X.

Is there an easy way to do this via code or extension ?

I have tried setting up 2 rules for this purpose. It works almost with a little problem.

Rule #1 (5% on 2nd X):

Condition:
SKU is X
Qty in cart greater than or equal to 2
Action:
Discount Amount: 5%
Max Qty to Apply Discount: 1
Apply on Condition: SKU is X

This is working fine. The problem is with the 2nd rule:

Rule #2 (10% on 3rd X):

Condition:
SKU is X
Qty in cart greater than or equal to 3
Action:
Discount Amount: 10%
Max Qty to Apply Discount: 1
Apply on Condition: SKU is X

It says if there are 3 or more products, apply a 10% discount on one of the products. Magento is applying the 10% discount on the already reduced 5% product instead of the unit base price.

How do I tell Magento to apply the 10% on the most expensive product or the non-discounted product ?

One solution: Applying some mathematics, I found that if I set Rule #2 to apply a discount of 10.5263% instead of 10%, it works. But the decimal points differ slightly which I can live with.

My concern is I am not sure if Magento always applies this discount on the already reduced product price or the base unit price.


texts: 404 in home page when open incognito Magento 1.9

texts:
I have an issue that I got 404 page when open the store in incognito mode but for the regular page in the browser it works fine because it is already cashed before.

Also when I tried to open any other page like categories or products page directly in incognito works fine, only the home page redirect to 404.

what could be the problem?, any help please.


texts: How to redirect customer to cart page if they are login from checkout page?

texts:
When customer login on checkout page then redirect to cart page in magento2?
if they are login from others pages then redirect customer dashboard page.


texts: How to add dynamic page URL in HTML template on Magento 2?

texts:
Is there anyone expert to help me out how to add dynamic page URL in my mention file path?

For example:

I want to get Create account url in html file but I didn't set it. I was trying with <?php echo geturl('create/account/create/'); ?> and also . But that code is not working. How can I set the url to html file in that path mentioned above.

File path:

app/design/......./Magento_Checkout/web/template/.html


texts: Suddenly customer_grid_flat table delete in magento 2

texts:
I am using Magento 2.2.6. My site is working fine. But today morning I show customer_grid_flat table delete in my database.

Please, someone, let me know why it's doing.

Also in Admin side customer page display SQL error


texts: Magento 2: Does Module Sequence Impact Layout Handle XML Loading Order?

texts:
Do the <sequence/> tags in module.xml files impact the order Magento will process layout handle XML files in?  My preliminary research says no, but that seems wrong so I'm looking for confirmation/proof that they don't (proof == source code points where layout handle XML file paths are generated and loaded)

If the sequence tags don't impact layout handle XML file loading order -- is there a way to change the module order these files are loaded in?

Specific problem I'm trying to solve is if I have the following loaded before the container is actually aded to the page

    <referenceContainer name="product.info.media">
        <action method="unsetChild">
            <argument name="block" xsi:type="string">product.info.media.image</argument>
        </action>
    </referenceContainer>

Magento barfs.


texts:
We have a magento site. Once an order has been processed using our point of sale program, we upload an xml file to our web server. Every hour a cron job is set to run to check the folder containing the xml file so that it will update the customers status in their account on our site. Once the cron job has run, it successfully updates the status but it's supposed to send an email to the customer notifying them that the order has been processed and despatched. I've tested this out and it generates the email however the email is not sent to the customer. Instead, it's sent to our own email address.

So my question is where can I find this status email in the magento backend in order to customise it and also how would I go about making this email go to the customer instead of our own address?

Appreciate any assistance.


texts: Small Icons suddenly in a Customised Luma theme

texts:
I've just noticed many of the icons have suddenly shrunk (in one case changed from a star to an arrow) within my theme. I have compared the CSS for this with another instance where everything was supposed to be identical other than a few colour changes.

CSS with Issues:

.minicart-wrapper .action.showcart:before {
 -webkit-font-smoothing: antialiased;
    font-size: 22px;
    line-height: 28px;
    color: #8f8f8f;
    content: '\e611';
    font-family: 'icons-blank-theme';
    margin: 0;
    vertical-align: top;
    display: inline-block;
    font-weight: normal;
    overflow: hidden;
    speak: none;
    text-align: center;
}

CSS that seems fine:

.minicart-wrapper .action.showcart:before {
    -webkit-font-smoothing: antialiased;
    font-size: 22px;
    line-height: 28px;
    color: #8f8f8f;
    content: '\e611';
    font-family: 'luma-icons';
    margin: 0;
    vertical-align: top;
    display: inline-block;
    font-weight: normal;
    overflow: hidden;
    speak: none;
    text-align: center;
}

The only changes I can notice is the font-family suddenly changing to icons-blank-theme from luma-icons both themes are based on the default Magento 2 luma theme however and changing the font-family back just breaks the icons turning them into squares. A'm unsure how this has changed or the best way to revert seen as this is across countless icons.

Does anyone know what could have caused this and the best way to fix it?


texts:
I'm trying to figure out why my checkout page is too slow, sometimes gives timeout, and sometimes after loading for minutes it works.

Few important things:

My platform is in production mode. Checked.

Server settings:

Processor: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz

CPUs: 8

RAM Memory: 8 Gb

HD: 160 Gb

Network: 800Mbs

Apache with PHP 5.6 and Varnish (Only for HTTP not for Checkout that uses HTTPS).

Is there anything wrong with it?

Thanks.


texts: How to activate newsletter under new customer page in admin panel?

texts:
Does anyone knows how to activate the "Newsletter" tab and/or show the checkbox for newsletter subscription under the registration page in admin?

I know how to activate under frontend, but i need to show the checkbox on the "first" step under the admin section, BEFORE clicking the SAVE button.


texts: Bundle Products are being double discounted

texts:
I have several bundle products enabled at a discount. They're all set up and working fine.

We also have several discount codes, and I do not want the discount codes to be able to apply to the bundles, I told it to exclude anything in the "gift sets" category, where all the bundles are.

However, since the bundles have items from other categories (for example, the shirt and pants that make up the bundle are in the "women's pants" category) that the discount is valid for, the discount still goes through.

Basically it is applying the discount based on the child products in the bundles and not the fact that the bundle products themselves are in an excluded category.

HELP!


texts: Add input fields as grid structure in cms page edit form

texts:
I added a custom tab in cms page edit form. In custom tab I create a form, and now I want to add/append a template(some input fields in grid structure) in this form in custom tab as a fieldset of cms page edit form.

here are example of template structure:

..................................................................

Textbox | checkbox | checkbox | checkbox

Textbox | checkbox | checkbox | checkbox

Textbox | checkbox | checkbox | checkbox

................................................................

Please help me how can i get done this task?
Thanks in advance.


texts: How to create a table in configuration system.xml file in Magento 2?

texts:
How can i create table in system.xml file is there any way? I had searched around but can't find any solution

want to create like this


texts: How to get and set data in checkout shipping address magento 2?

texts:
I have added custom drop down list into checkout shipping address like this:

$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
            ['shippingAddress']['children']['shipping-address-fieldset']['children']['drop_down'] = [
                'component' => 'Magento_Ui/js/form/element/select',
                'config' => [
                    'customScope' => 'shippingAddress',
                    'template' => 'ui/form/field',
                    'elementTmpl' => 'ui/form/element/select',
                    'id' => 'drop-down',
                ],
                'dataScope' => 'shippingAddress.drop_down',
                'label' => 'Distrist',
                'provider' => 'checkoutProvider',
                'visible' => true,
                'validation' => [],
                'sortOrder' => 251,
                'id' => 'drop-down',
                'options' => [
                    [
                        'value' => '',
                        'label' => 'Please select'
                    ],
                    [
                        'value' => '1',
                        'label' => 'One'
                    ],
                    [
                        'value' => '2',
                        'label' => 'Two'
                    ],
                    [
                        'value' => '3',
                        'label' => 'Three'
                    ]
                ]
            ];

How can I get the value and data-title has been selected then set it in the city field?

Thank you!


texts: how to position a block in magento 2 checkout page

texts:
I want to add referral code block to move on the top, above Payment Method. How can I do it?

Layout code:

<?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">
    <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="component" xsi:type="string">uiComponent</item>
                                            <item name="children" xsi:type="array">
                                                <item name="payment" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="afterMethods" xsi:type="array">
                                                            <item name="children" xsi:type="array">
                                                                <item name="creditamount" xsi:type="array">
                                                                    <item name="component" xsi:type="string">My_Module/js/view/payment/customform</item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>


texts: Product delete option for each product as edit in admin product grid

texts:
I am using magento 1.8.
My requirement is to display delete option in product grid in front of each product like "Edit" option.
I have created column and able to display the Delete option in grid using following code in

Npm_Product_Adminhtml_Block_Catalog_Product_Grid

$this->addColumn('Delete action',
            array(
                'header'    => Mage::helper('catalog')->__('Action'),
                'width'     => '50px',
                'type'      => 'action',
                'getter'     => 'getId',
                'actions'   => array(
                    array(
                        'caption' => Mage::helper('catalog')->__('Delete'),
                        'url'     => array(
                            'base'=>'*/*/delte',
                            'params'=>array('store'=>$this->getRequest()->getParam('store'))
                        ),
                        'field'   => 'id'
                    )
                ),
                'filter'    => false,
                'sortable'  => false,
                'index'     => 'stores',
        ));

When I click on delete it redirecting but showing 404 error, Any idea how can I implement this requirement?

How can I call productController deleteAction from here with parameter product id
Thanks in advance:)


texts: Magento 2: How to filter product collection using product's final price

texts:
How to filter product collection using product's final price. As I have special price and catalog price rule applied on the products.

here is my code:-

$searchedProducts = $this->_productCollectionFactory->create();
$searchedProducts = $searchedProducts->addAttributeToSelect('*')
                        ->addAttributeToFilter('price', array(
                                array('gt' => $pricefrom, 'lt' => $priceto),
                            )
                        );

Above code filter the product using price.
But not give any result if i am using final_price in the product.

I want to filter products form there final price range.


texts: How to update the grand total amount manually?

texts:
I'm in the last step of Magento's default one page checkout. There I check whether taxes are applied or not due to the VAT rules within the EU for B2B customers. It was a battle till that point but now I'm feeling that I have entered the dragon's lair. The last big step is to update the grant total amount but I don't see any way to do that in a more or less easy way.

For the quote of Mage::getSingleton('checkout/session')->getQuote() I was expecting some kind of setters but it seems to me that there are no one.

Creating a whole new order quote seems to be possible but is a lot of overhead and looks quite fault-prone to me.

So another idea was to remove the items of a quote and put in custom (duplicated) items with prices without tax. But before trying this out I would like to ask you if there's a smoother way to update the grant total amount. Thank you in advance!


texts: Magento displays "Excl. VAT" when it should display "Inc. VAT"

texts:
I'm setting up my first Magento theme/install, but have an issue where the catalog/listings page is showing the price with a "Excl. VAT" label.

E.g. price entered is £8.95.
VAT rate is set to None.
System > Config > VAT is set to show prices including tax everywhere, and calculate tax (not that there is any to calculate) based on the prices being entered inclusive of tax.

If anything, I'd expect it to show Inc. VAT based on the config, but I'd also like to be able to turn this off all together, in case in the future the store is VAT registered and it needs to be easily switched on.

UPDATE:

It appears to be set via CSS, so I am now trying to find out if the CSS is determined by Magento.

The class is particular is .product-price-939

£19.95


texts: How to add a multi select category and attribute filter on catalog page

texts:
My magento 2.3.3 theme provides me single select from same category or attribute.

Here if i select a sub category all the other categories will get disappears because it is single select.
But i want is a multi select filter where i can filter multiple sub categories and attributes.
Like this

Is there any free extension or we can do it by custom module.
Please Guide me.


texts: Enable the Browser's Autocomplete in Onepage Checkout Form

texts:
How to enable autocomplete for the checkout form?
Currently my browser (chrome) does not store any input values...


texts: I want to clear all cart items in magento cart (In all PCs from all over world)

texts: When i run a script then clear cart items from all PCs which already added a cart item(s).


texts: Magento 2.3 - LEMP - Nginx hosts - Backend & frondend url 404 error

texts:
My LEMP localhost URL : 192.168.1.64:8087/giri I want to stup multiwebsite so that i have configured url like www.giri.local by using follow steps,
Nginx : etc/hosts
192.168.1.64:8087 www.giri.local
After added above location my magento backend url changes to www.magento.local/admin_76tE and both Backend & frondend url 404 error
Error Screenshot : https://snipboard.io/dOtLuT.jpg


texts:
I have multi-select attribute name location like : Delhi , Maharashtra, Karnataka.

I want to use sort by of filter by in such way when I use above filter / sort it should show all products but product with matching attributes should show on top.

for example if I am using filter/sort with value as Maharashtra all products should show on listing page but products with value Maharashtra will be on top .

I can not find any way to do same please help with it how can it be done.


texts: How do you correctly specify a filter to get all orders that have been updated since date

texts:
I have tried to create a filter to get all updated orders since date...

rest/V1/orders/searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]=2018-01-01T14:01:54.9571247Z&searchCriteria[filter_groups][0][filters][0][condition_type]=gt

I got the following error

{
    "message": "Invalid type for value: \"searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]=2018-01-01T14:01:54.9571247Z&searchCriteria[filter_groups][0][filters][0][condition_type]=gt\". Expected Type: \"int\".",
    "trace": null }

I read this as ... can't use a date with a gt condition. How do I get the result I am looking for?


texts: Is there any chance to apply Catalog Price Rules on MSRP[Manufacturer's Suggested Retail Price] by adding option By Percentage on MSRP in the catalog price rules actions


texts: How do I add my Magento extension to Magento Connect store?

texts:
I have developed some extension for Magento. If I found it as useful for someone:

how can I add that extension to Magento Connect?
Is there some kind of requirements and specifications?
Do someone expertise my extensions and approve it before adding to pool?
How do I sell and what requirements for merchandising?

Please provide some guide, thanks for answers.


texts: Open header cart when product added to cart

texts:
I'd like to know how I can automatically open the header mini cart when a product is added to the shopping cart.

At present if you add a product to the cart the default Magento message appears which is fine but I would also like the header cart to expand to show more details.

The header cart has a hover action and the code looks like this

<div class="block-cart header-cart pull-right" id="ajaxcart">

I just need to know how to trigger it when an item is added to the cart and if possible how to close it again within perhaps 15 seconds of it opening.

Thanks

Update

I've added this code to my templates header file

<?php if (Mage::getSingleton('checkout/session')->getCartWasUpdated()) {

echo '<script>';
echo 'jQuery(document).ready(function(){';
echo 'cart_autoopen();';
echo '});';

echo 'function cart_autoopen(){';
echo '$(\'.add-to-cart\').click(function(){';
echo '$(\'.header-cart\').trigger(\'click\'); // this will open the cart if it was already closed';
echo 'setTimeout(function(){$(\'.header-cart\').trigger(\'click\');},15000);   // this will close the cart after 15 seconds. ';
echo '});';
echo '}';
echo"</script>";

};

?>

At the moment it isn't working but I think this is because the javascript is using a click trigger instead of mouse over.
If someone cleverer than I am edit my code so that it triggers an onmouseover instead I think this could work.


texts:
I am running a Magento 2.1.9 Shop with the built in FPC enabled. After a couple of days the /var/page_cache folder has over 10GB more in size, after some more days its 15GB and so on, it never stops, I had to clear that folder when it was at 220GB! The store has ~18000 products.

I know I can delete that folder daily, but this results in the website being slow again. Is there some option I am missing?


texts:
I have very critical issues in Sales Overview report. I have 3 Stores and 3 Currencies.
Now when i am checking sales report of individual store then report is showing fine.
But
I want to see Overview Sales of complete website (inc all stores).
Now on sales overview dashboard $49 and AED175 is counting as PKR49 + PKR175.
But first I want convert $ to PKR and AED to PKR ( Then those prices should be add into Subtotal & Total ).
There is any solution is available for this issue. any extension or code please suggest me.
Check attached screenshots for more understanding (order Page & Sales Overview )

Thank you.


texts: Store multiple quotes for a customer to be later approved and created as orders

texts:
I want to build a different checkout system where the customer doesn't create an order upon checkout but his quote is permanently stored for a later review.  The review will be a background process which needs to locate the quote and create an order from it.
I am familiar with how to create an order from a quote. I am also familiar with how the quote works. It's tied to the cart and old quotes are deleted on a regular basis.
My question is how should I approach this problem? Should I somehow modify the cart functionality, copy the existing cart (and all its tables) into my own model, or modify the order functionality (such as adding a flag if it's approved or not).
Thanks in advance.


texts: Paypal Advanced - Payment has been declined. Please try again

texts:
I am using PayPal Advanced.  I ran tests on it about one month ago and it was working fine.  Then I started getting "pending payment" in my magento admin panel even though the payment had gone through.  Last Saturday, a customer reported that it froze during the checkout process so she wanted to confirm if her payment went through.  It did go through.  Then I ran a real test transaction using the company credit card.  Now all purchases say "Payment has been declined. Please try again" and Magento cancelled the payments.  BUT the payment went through properly on PayPal.  I spoke to PayPal, they adjusted some setting in PayPal Manager and on Paypal.com.  I set up my IPN as well.

Now payments properly appear as "processing" in my admin panel and payment successfully goes through PayPal.  BUT "Payment has been declined. Please try again" still appears whenever a customer tries to checkout.  From the backend, I have no way of knowing that the customer received this message.  I set the payments to "authorize" not "sale" so I can void duplicate transactions --- every time a customer puts their credit card information in again, it charges them again.  PayPal says it is due to an extension I am using... I find this hard to believe since it worked fine with all of my extensions before and then randomly stopped working.

I upgraded to Magento 1.9. All extensions work properly.  AFTER UPGRADING, I started using PayPal advanced.  So it did not tell customers payment is declined on Magento 1.9 with all extensions, and now it does.


texts: magento 2 - how to override full flow of Configurable product in custom side

texts:
I want to override full admin grid about configurable product in custom side in magento 2

Can you give me path of all files which affect configurable product admin side?


texts: Magento 1.9 RWD new-order e-mail broken table

texts:
Look at my attachment. This is how my new-order e-mail looks like? Look at the bottom. What's happening with the totals table?

How can i fix this?


texts: Magento 2 in how to splited in bulk import child categories using(,)?

texts:
how to split in child categories in bulk import categories using (,)?

    Default Category/Tools,Default Category/Tools/Electrical Supplies,Default Category/Tools/Electrical Supplies/Boxes,Switches,Plugs & Sockets,Default Category/Tools/Electrical Supplies/Boxes,Switches,Plugs & Sockets/Electrical Boxes

bulk import in category is wrong path to created.


texts: How to optimize the images of a magento 2 site?

texts: There is a site which have a lot of images of high quality because of which the load time of site is quite high. It is impossible to optimize images one by one as we have many images. So could anyone please let me know how it I optimize all the images??


texts: Display product reviews by specific attribute

texts:
I'm trying to create the collection of latest 5 reviews from products with specific attribute (e.g. - brand). Here is my current code that displays just latest 5 reviews:

<?php
$reviews = Mage::getModel('review/review')->getResourceCollection();
$reviews->addStoreFilter( Mage::app()->getStore()->getId() )
                ->addStatusFilter( Mage_Review_Model_Review::STATUS_APPROVED )
                ->setDateOrder()
                ->addRateVotes()
                ->setPageSize(5)
                        ->setCurPage(1)
                ->load();

?>

<?php
foreach($reviews as $review) {
    $review_data = $review->getData();
    $product = Mage::getModel('catalog/product')->load( $review_data['entity_pk_value'] );
    ?>

Review of: <?php echo $product->getName() ?>

<?php echo $review_data['detail']; ?>

    <?php
}
?>

Is there any way to apply some filter to $reviews collection so it'll contain just reviews from specific attribute name?

Thanks for help.

UPD: code that works: https://gist.github.com/dimsemenov/5845535


texts: No customers displayed after Migrate to 2.0

texts:
I migrated the Magento 1.9.1.0 to Magento 2.0.  No errors encountered while doing the migration using data migration tool.

After migration when I hit the customers It returns 0 records.  But when I check the customer_entity table it has all customer records.

I noticed that customer_grid_flat table is empty and because of that none of the customer is listed from the admin interface.

Is there any solution for this?


texts:
I am trying to call external api from Magento. Below is the request,

$client = $this->_httpClientFactory->create();
$client->setUri('thirdpartyurl.com/api/');
$client->setMethod(\Zend_Http_Client::PUT);
$client->setHeaders(\Zend_Http_Client::CONTENT_TYPE, 'application/json');
$client->setHeaders('Accept','application/json');
$client->setHeaders("Authorization","Bearer 1212121212121");
$client->setParameterPost($params); //json
$response= $client->request();

return $response->getBody();

Always response comes as

Unable to read response, or response is empty

Any help would be appreciated.


texts: How to redirect the Magento 2 controller into post page

texts:
When I click on add to cart button from my custom page.

If products are avaiable it goes to the Cart page and if not they are redirected to the Post page, but it redirects to the Index page.

Can anyone please help me?

Thanks!


texts: Modifying product collection for list page not working in magento 2

texts:
I am trying to Modify Product collection which provides collection for product listing page aka category page. For this I have overridden _getProductCollection function of Magento\Catalog\Block\Product\ListProduct. In that function I am trying to do something like below:

if ($this->_productCollection === null) {
            $this->_productCollection = $this->initializeProductCollection();
        }
        $productIds = array();
        foreach($this->_productCollection as $key=>$product)
        {
            $_product = $this->helper->getProduct($product->getId()); // called custom helper function to load product
            if($_product->getAttrCode() !='' && $_product->getAttrCode() == 1)
            {
                $productIds[] = $_product->getId();
            }
        }
        $this->_productCollection->addFieldToFilter('entity_id', array('in'=>$productIds));
        return $this->_productCollection;

In system.log file, It shows this error - main.CRITICAL: Illegal state [] []


texts: How to create a working custom order for product category page?

texts:
I have an issue with customising the order in which products appear on the main category listing page in Magento. I’m running CE version 1.8.1.0, and using the Grayscale custom theme, although this isn’t actually a theme issue.

Basically I wanted the products (of which there are 12) to appear in a very specific order. I tried both “Best value” (which turns out to be the same as Position) and created a new attribute called Listing Order, and in each case gave the products values from 1 to 12.

However, in the front end if I select to view all 12 (whether that’s “All” or “12” in the dropdown), the first 9 display ok (in 3 rows of 3) but then a column is missed, and the next product appears in the middle column, the one after that in the end column and the final product jumps down to a row by itself.

This happens both for sorting by Position and by the custom attribute, Listing Order.
It isn’t a problem with the CSS or template- if I sort by Price or by Name then I can view all 12 products on the page without any issue. But if I try using one of the other two ways of sorting, it jumps the first position in the fourth row (which would be the position for the 10th product) and messes up the page.

My client doesn’t want to sort it by Price or Name, but by their specific custom order.
So at the moment I’ve set the page to sort by Listing Order and only show 9 products, and the next 3 show on the 2nd page (and oddly enough they show fine). But again this isn’t a fix because the client wants them all on a single page.

I even tried a CSS workaround, adding a numeral or letter to the beginning of the product name and then sorting by name- using this technique to format and then hide the first letter:

h2.product-name::first-letter {font-size:1px; color:#fff !important;}

However although that hid the initial, all else that it did was cause even more product positions to be “jumped” meaning more products jumping down onto the next row.

This is the sort of thing that should really be straightforward, but as I’m constantly discovering to my cost, almost nothing in Magento is straightforward.
Has anyone got any ideas or come across this issue?


texts: Get Product Attribute In Custom PHTML block added to product page through xml

texts:
I've created a phtml file to display some custom product attributes on my product page however I am unsure how I can get the product attribute to display?

I've tried

 <?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$_product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id);
echo $_product->getData('fld_sub_title');
?>

but keep getting internal server error from this :(

Any help would be appreciated


texts: Magento 2: Compile-Multi-Tenant "Not Defined"

texts:
My Module reject from Marketplace QA testing. The error they gave was:

[ReflectionException]
Class \Fanplayr\SmartAndTargeted\Controller\Index\Index does not exist

They also let me know test command they used:

php -f /var/www/html/bin/magento setup:di:compile-multi-tenant 2>&1

With my local copies of Magento 2 (both CE and EE) I get an error when trying to do 'multi-tenant' compilation:

[InvalidArgumentException]
Command "setup:di:compile-multi-tenant" is not defined.

Any idea of why Magento 2 would not be allowing me to do a 'multi-tenant' compilation?

Would this 'multi-tenant' compilation give me errors that normal compilation wouldn't?


texts: Saving custom data against a sales order item

texts:
I am programatically saving orders. I need to be able to set a custom data for order items in sales_order_item table. What is the best way to do this?

I notice there is an additional_data column which looks ideal, however, I don't seem to be able to save data to it.

Code of what I've tried below...

$cartId = $this->cartManagementInterface->createEmptyCart();
$quote = $this->cartRepositoryInterface->get($cartId);
$product=$this->_product->load(1);
/**
 * Try to add the column here
 */
$product->setData('additional_data', json_encode(["ewfe" => 'wefwef']));
$quote->addProduct($product, 1);

// Set all shipping / customer details etc

$quote->getPayment()->importData(['method' => 'checkmo']);
$quote->save();
$quote->collectTotals();

// Create Order From Quote
$quote = $this->cartRepositoryInterface->get($quote->getId());
$orderId = $this->cartManagementInterface->placeOrder($quote->getId());

Running this saves the order, but does not add any data to the additional_data column.


texts: File upload field in admin page does not have value when editing

texts:
I created a form and it only contains a file upload field. Uploading new file works properly. However, when I want to edit the record, the file upload field shows "No file chosen", and when I go to save the record without choosing the file, it warns me to select a file since it is a required field. My question is how to put the value from database and prevent it from modification when no new file is chosen?

Thank you in advance.

Here is my code

    class Company_Module_Block_Adminhtml_Fileupload_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {

    protected function _prepareForm() {
        $form = new Varien_Data_Form();
        $this->setForm($form);

        if(Mage::registry('fileupload_data')) {
            $data = Mage::registry('fileupload_data')->getData();
        }

        $fieldset = $form->addFieldSet('fileupload_form', array('legend' => 'File Upload'));

        if(isset($data['filepath']) && $data['filepath']) {
            $fileName = $data['filepath'];
            $data['filepath'] = 'directory'.'/'.$fileifName;
        }

        $fieldset->addField('filepath', 'file', array(
            'label' => 'File',
            'name' => 'filepath',
            'index' => 'filepath',
            'required' => true
        ));

        $form->setValues($data);
        return parent::_prepareForm();

    }

}

Update:

editAction

public function editAction() {
    $id = $this->getRequest()->getParam('id');
    $model = Mage::getModel('model/files')->load($id);
    if($model->getId() || $id == 0) {
        $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
        if(!empty($data)) {
            $model->setData($data);
        }
        Mage::register('fileupload_data', $model);
        $this->loadLayout();
        $this->_setActiveMenu('fileupload/fileupload');
        $this->_addContent($this->getLayout()->createBlock('fileupload/adminhtml_fileupload_edit'))
                ->_addLeft($this->getLayout()->createBlock('fileupload/adminhtml_fileupload_edit_tabs'));
        $this->renderLayout();
    } else {
        Mage::getSingleton('adminhtml/session')->addError('File does not exist');
    }

}


texts: Unregister event observer programatically

texts:
Does anyone know if it's possible to unregister an event observer programatically?  I have an observer on newsletter_subscribe_save_after that updates a custom attribute in the customer model but when the customer record is saved it triggers off the customer_save_after event defined in Mage_All.xml which then re-saves the newsletter subscription status resulting in an infinite loop that then triggers the PHP recursion error due to nesting 100 times.

Ideally I'd like to unregister the customer_save_after event only when my observer fires.


texts: reorder not setting the shipping method used last time

texts:
I want to reorder a product programmatically. For this I'd followed the answer: Magento - Programmatically reorder. But I'm getting error message

  Please specify a shipping method.

Why isn't it setting the shipping method used earlier?


texts:
I'm trying to add a new field to order grid with custom filter. Right now I managed to make it work, but I want to add my custom filtering rule.

I added the column to db_schema.xml and in my module's sales_order_grid.xml file I added:

<columns name="sales_order_columns">
    <column name="custom_field">
        <settings>
            <filter>select</filter>
            <options class="My\Module\Component\Listing\Columns\CustomFieldOptions" />
            <dataType>select</dataType>
            <label translate="true">Custom Field</label>
            <visible>true</visible>
        </settings>
    </column>
</columns>

In my CustomFieldOptions class I have:

<?php
declare(strict_types=1);

namespace My\Module\Component\Listing\Columns;

use Magento\Framework\Data\OptionSourceInterface;

class CustomFieldOptions implements OptionSourceInterface
{
    /**
     * @var string
     */
    private const VALUE = 'value';

    /**
     * @var string
     */
    private const LABEL = 'label';

    /**
     * Return array of options as value-label pairs
     *
     * @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...)
     */
    public function toOptionArray() :array
    {
        return [
            [
                self::VALUE => 1,
                self::LABEL => 'Realized'
            ],
            [
                self::VALUE => 0,
                self::LABEL => 'Outdated'
            ],
            [
                self::VALUE => -1,
                self::LABEL => 'Canceled'
            ]
        ];
    }
}

My custom_field is DateTime, but I want to filter it using those 3 CustomFieldOptions parameters:

I want to specify my own filtering rule (for example option Canceled should filter only records with null value of my custom_field, Outdated should return records with custom_field value that's older than current day).

Can you help me with what should I do now? Thanks in advance!


texts:
I just had one of those moments where I realized I don't understand something.  What does the Mage part in say Mage::helper or Mage::log represent?

There is no class Mage{ .. } in Magento.

Thanks for your understanding on what is probably an obvious answer.


texts: Magento 2 : Add Button to Existing Listing Component

texts: I'm creating a custom module trying to add a custom button to CMS pages listing component. How do I add this. I'm using magento 2.2.


texts: Magento 2 checkout login with mobile number or email

texts:
I want to allow the customer to Log in using email or mobile number on the checkout page and the login page.

Note: Mobile number is customer eav attribute.


texts:
I am importing product with csv file of 200 products.

Two product have same name, so when in import i am getting below error.

 Url key: 'key' was already generated for an item with the SKU: '39921'. You need to specify the unique URL key manually

How can i suppress this error, can we not create the product with same name with url key is different?

I need to import product with same name for both the products.

How this can be done? Please anyone suggest me


texts: Magento 2 Product Collection returning no results

texts:
I have recently migrated our Magento 1.9.2.4 store to Magento 2.2.5.

I am currently writing a module to allow certain customers to order products in batch.

I have created a very similar module before for another website we have, so i know the process of how to do it.

I am currently trying to pull in products by their category. However, when i do this no results are returned. Since then i have tried to just pull in every single product we have, ~4000 of them, however this still returns an empty result set.

I am pretty sure that all of the product categories have been assigned the relevant products, and this is shown in the back end in both individual product pages and also the category pages.

some examples of code i have been using:

All products:

$collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
        $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);

Products by category:

$collection = $productCollection->create()
              ->addAttributeToFilter('attribute_set_id','174')
              ->addAttributeToSelect('*')
              ->load();

Constructor:

public function __construct(
        \Magento\Backend\Block\Widget\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Framework\App\ResourceConnection $resource,
        \Magento\Customer\Model\Group $customerGroupCollection,
        \Magento\Catalog\Model\CategoryFactory $categoryFactory,
        \Magento\Catalog\Helper\Category $category,
        \Magento\Catalog\Model\CategoryRepository $categoryRepository
    ) {
        parent::__construct($context);
        $this->_productCollectionFactory = $productCollectionFactory;
        $this->_customerSession = $customerSession;
        $this->_customerGroupCollection = $customerGroupCollection;
        $this->_resource = $resource;
        $this->_categoryFactory = $categoryFactory;
        $this->category = $category;
        $this->categoryRepository = $categoryRepository;
    }

What could prevent products from being pulled through?


texts:
is there a way to create a custom back-end when adding a new field to a form's fieldset?

ie:

$newField = $fieldset->addField('new_field', 'text', array(
   'name' => 'foo',
   'value' => 'bar',
   'backend' => 'mymodule/custom_field_type',
   ...
);


texts:
I want to run an offer where customer can select any 3 product for 999.

Kindly advice me how formulate the option.


texts: Running Cron Scripts From a Sub-directory

texts:
My html directory is becoming bloated so I am trying to reorganize the files. I have a few scripts that I have running on a cron job and I want to move them out of the html directory.

For example:

cronjob: php /chroot/home/mydomain/html/restock.php

restock.php:

<?php
require_once('app/Mage.php');
umask(0);
Mage::app();

my script

?>

What I would like is a directory called 'myscripts' or similar and have all my scripts sitting in there. My question is what is the best practice for this and also how would I modify my php scripts and cronjob???


texts: customer first name and last name separately (Magento 2)

texts:
I am trying to get First Name and Last Name from the session.
But I am not able to get First name or last name.

Instead, I am able to get the full name.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$customerSession = $objectManager->create('Magento\Customer\Model\Session');

$customer_name = $customerSession->getCustomer()->getName();  // gives me result

But when I try to get first it returns null

$customer_first_name = $customerSession->getCustomer()->getFirstName();  // gives me null

How to get the first name using customerSession->getCustomer()


texts: undo a unintentionally rootcategory move

texts:
i had this category structure:

  root 1
   - sub1
   - sub2
  root 2
  root 3

now i accidentally drag and dropped "root 2" into "root 1":

  root 1
   - sub1
   - sub2
   - root 2
  root 3

How can i undo this?
Drag and drop seems not to work. I also tried to change the db fields catalog_category_entity.parent_id to 1 and catalog_category_entity.level to 1 directly. No effect (cache was rebuilt).


texts: Static text blocks between simple product's custom options

texts:
I like to add static Text fields (output not user input) between simple product's custom options. After long research I could find a proper extension or a solution for this..

The text parts will be different for each product.


texts: Magento 2 - How to Make "Reorder" button in the reorder history to always appear?

texts:
Reorder button doesn't show up when an item is out of stock. How can I make the code to ignore this condition and allow customer to reorder by excluding the out of stock item.

The "Reorder" button only appears on some orders in order history.
The method responsible for reordering is Mage_Sales_Model_Order::_canReorder(). The method _canReorder is called by Mage_Sales_Model_Order::canReorder(). This is actually called to see if you can reorder.
Inside the canReorder() function:
if (!$ignoreSalable && !$product->isSalable()) {
    return false;
}

"isSalable" checks product’s “status”, stock availability.
Right now, how the "reorder" button works is that, if an order history X has n items. if 1 item out of the n items is out-of-stock, the reorder button doesn't appear. I'm wondering how can I make the reorder button to always appear, so when a customer clicks on the reorder button, it will create the new shopping cart with the items that are available.
Can I just remove the "isSalable()" from this if statement?


texts: Magento 1 - Quote data is null but order is created and processed

texts:
Have been trying to figure out why this happens. We have a shop that runs Magento 1.9, that doesn't use the built-in customer account/sign in functionality when creating orders etc. We never require you to sign up when creating an order in the frontend.

For some odd reason there are around 20 orders that doesn't have customer data, either the firstname, lastname or email column are null. This data is null both in sales_flat_quote and sales_flat_order and sales_flat_order_address. The columns "created_at" and "updated_at" in the sales_flat_quote table are null as well. The funny thing here is that the order is created and processed but the customer doesn't receive a notification email since the email provided to the order model was never set (or for some reason deleted during the process).

Any clues what the issue could be? Have you ever experienced this problem?


texts: Some product but diffrent attribute for each store view

texts:
We have many products in our store.

For each state in Germany we have a special product attribute and a different price.

User visit our website. Next step is to select the location/state in a popup.
Now we need to show the selected store with the correct attribute.

How we can manage the attribute and price depending on the selection?

The Problem is the price attribute we can only set to global view.


texts: addAttributeToFilter date older than 14 days

texts:
I have a custom attribute called customer_products_changedate it saves the date when I link a product to it and it's linked to the customer.

How do I get the customers, filtered by that attribute, but only if the date in the attribute is older than 14 days.

I currently have this:

$collection = Mage::getResourceModel('customer/customer_collection');
$collection->addAttributeToFilter('customer_products_changedate', 'OLDER THAN 14 DAYS');

Would also be nice how to do delete those attributes than, not the users, just those attribute entries.


texts: Add Product to Wishlist with a Selected Custom option

texts:
I used below code to add a product pragmatically  to a Wishlist, and is working successfully-

  $customer = Mage::getModel('customer/customer');
  $wishlist = Mage::getModel('wishlist/wishlist');
  $product = Mage::getModel('catalog/product');

  $customer_id = 1;
  $product_id = 1;
  $customer->load($customer_id);
  $wishlist->loadByCustomer($customer_id);
  $wishlist->addNewItem($product->load($product_id));

My Question is that if I am having a Product with a Custom Option, then how could i add that selected option to a wishlist.

Completely, I need a Code which can add Product to a Wishlist with a selected custom option.

Please help me on this.


texts: How to redirect customer from controller not observer to login page magento 2

texts:
I want to redirect customer to login page in my controller without using observer.
here is my code

 protected $urlInterface;

    public function __construct(

        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\App\Response\RedirectInterface $redirect,
        \Magento\Framework\UrlInterface $url,
        \Magento\Framework\App\ResourceConnection $resource,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Customer\Model\Session $customerSession,
        \Magenticians\Evaluation\Model\EvaluationFactory $EvaluationFactory,
        \Magenticians\Evaluation\Model\Evaluation $eval,
        \Magenticians\Evaluation\Model\ResourceModel\Evaluation\Collection $evaluationCollection,
        \Magento\Framework\Controller\ResultFactory $result)
    {
        parent::__construct(
            $context
        );
        $this->EvaluationFactory = $EvaluationFactory;
        $this->_customerSession = $customerSession;
        $this->_storeManager = $storeManager;
        $this->resultRedirect = $result;
        $this->_resource = $resource;
        $this->_evaluation =$eval;
        $this->_evaluationCollection = $evaluationCollection;
        $this->redirect = $redirect;
        $this->urlInterface = $url;

    }

        // Create login URL
        $login_url = $this->urlInterface
            ->getUrl('customer/account/login');

                $resultRedirect = $this->resultRedirectFactory->create();
                $resultRedirect->setUrl($login_url);
 $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();
        $this->_view->renderLayout();

but as result i have no redirection response please help me and thanks in advance


texts:
I am getting

404 Error
Page not found

in the main content area of my admin module. Both the header and footers are displayed, but im left with a white screen between, with no other information than what ive posted.
In var/log/admin.log

2013-09-11T08:33:34+00:00 INFO (6): myname /admin/controller/action/
2013-09-11T08:33:34+00:00 INFO (6): myname /admin/controller/action/

The action that it is trying to access is
public function newAction()
{
    $this->_forward('*/*/edit');
}

The layout file node maps to that edit controllerAction. How do I resolve this issue?


texts: Magento CE 2.2 - Cookies/Cache/Session issue when Server Load overloads

texts:
Aside from the obvious answer of upgrading the amount of CPUs on our webhost to alleviate the traffic and prevent Server Load overloads, we are trying to find out what we can do about the cache/cookie/session issue that comes when the server does overload and essentially resets.

We use Cloudflare and mostly default cookie settings for our website;

Cookie Lifetime             36000
Cookie Path                 [blank]
Cookie Domain               [blank]
Use HTTP Only               Yes
Cookie Restriction Mode     No

We also have set our Base URLs and Base URLs (Secure) to https:// and our Session Validation section options are all set to No

What happens when server overloads (for some but not all customers):

Most commonly, they will have products added to their cart, but any time they try to go to checkout, it just sends them back to the home page. With that, I am assuming it is trying to check their cookies to clarify they are who they say they are, same session, whatever it be, and the customers browser data doesn't match with what the overloaded/reset webhost has, thus it boots them back to the homepage. Generally the fix for this is for them to clear their cookies/cache and do a hard reset, or use a different browser which will allow them to carry on normally.

Any ideas whats going on here? Or what we can do to alleviate this issue?


texts: After Upgrade from Magento 2.1.6 to Magneto 2.3.2 i get below error

texts:
After upgade Magento 2.1.6 to 2.3.2 i am try to run php bin/magento setup:upgrade it's give below error

  SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
  update a child row: a foreign key constraint fails
  (latest.catalog_product_entity_datetime, CONSTRAINT
  CAT_PRD_ENTT_DTIME_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY
  (entity_id) REFERENCES catalog_product_entity (entity_id) ON
  DELETE C), query was: INSERT INTO
              catalog_product_entity_datetime(attribute_id, store_id, entity_id, value)
              VALUES
              (:attribute_id0,:store_id0,:entity_id0,:value0),(:attribute_id1,:store_id1,:entity_id1,:value1),(:attribute_id2,:store_id2,:entity_id2,:value2)
              ON duplicate KEY UPDATE value = VALUES(value)

Please assist me.


texts: Shipping method filtering based on order total

texts:
I have a magento 2.2.3 site. In checkout we have enabled  two shipping options. Table rates and free shipping. Orders above 100$ we provide free shipping charges. But sometimes this does not work
Suppose, the subtotal for particular order is 160$. After discounts or promotions etc order total comes as 60$. Then in the checkout free shipping options should not be displayed and table rates should be applied.  Checkout shows both options. What I want is to display only one of the option based on the Order total not the subtotal.
Could anyone please advice on this ??


texts: catalog_product_import_finish_before Event in magento2?

texts:
Created an observer file in Magento1, using event

  catalog_product_import_finish_before

event

     $productIds = array();
            $adapter = $observer->getEvent()->getAdapter();
          $resource = $this->_stockCollection;

          if ($adapter instanceof Mage_Catalog_Model_Convert_Adapter_Product) {
            $productIds = $adapter->getAffectedEntityIds();
            $this->_logger->info(print_r($productIds),true);
       } else {
         Mage_ImportExport_Model_Import::getDataSourceModel()->getIterator()->rewind();
           $skus = array();
           while ($bunch = $adapter->getNextBunch()) {
              foreach ($bunch as $rowData) {
                   if (null !== $rowData['sku']) {
                   $skus[] = $rowData['sku'];
                }
              }
         }
           if (!empty($skus)) {
              $productIds = $resource->getProductsIdBySku($skus);
         }

How to get this Mage_Catalog_Model_Convert_Adapter_Product file and AffectedEntityIds in Magento2?


texts:
I need get the name of category from ('catalog/product') table in Magento 1.9. How can I do it ? Main table is ('productlabels/category')

protected function _prepareCollection()
{
    $collection = Mage::getModel('productlabels/category')->getCollection();
    $collection->getSelect()
        ->joinLeft(array('category' => $collection->getTable('catalog/category')), 'main_table.id_category = category.entity_id')
        ->joinLeft(array('labels' => $collection->getTable('productlabels/table_labels')), 'main_table.id_label = labels.id_label');
    $this->setCollection($collection);
    return parent::_prepareCollection();
}

Also I have an edit form where I need to output my edit data.

protected function _prepareColumns()
{
    $helper = Mage::helper('productlabels');
    $this->addColumn('name', array(
        'header' => $helper->__('Name'),
        'index'  => 'name',
    ));

    $this->addColumn('category_page_image', array(
        'header' => $helper->__('Label Image'),
        'index'  => 'category_page_image',
        'type' => 'image',
        'renderer' => 'Plumrocket_Productlabels_Block_Adminhtml_Renderer_Image',
        'filter'    => false,
        'sortable'  => false,
        'align' => 'center',
    ));

    return parent::_prepareColumns();
}

Any help would be greatly appreciated.


texts: Magento 2: How to add the home page URL in sitemap.xml

texts:
How to add the Homepage URL in sitemap.xml with priority 0.1 in Magento 2?

Please Help me.


texts: Magento 1.9 Configurable Products Options and cart issue

texts:
I'm working on a magento 1.9 site, it have strange issue, we we go to a configurable product page it don't show the product options and ad to cart button.

-The list pages show the other two option images when mouse over.

-Can't see any js errors on console

-The product type also detect as configurable on product page.

-i also tried by apply default theme, it also same results.

-also checked stock and other things those seems fine.

List Page

Product Page

Anyone have a idea about this kind of issue


texts: Redirect to new product page instead of current product Page

texts:
Onclick custom button "Register" (present in product view page), we are trying 3 things:

Register user to site. (Working)
Create new product programtically. (Working)
Redirect to newly created product url (Not Working Instead, its redirecting to same Product's url)

public function createSimpleProductAndRedirect1Action()
{
    $originalProductId = $this->getRequest()->getParam('id');
    $originalProduct = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($originalProductId);

    if ($product = $this->_createit(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, true, $originalProduct)) {
        if (Mage::getSingleton('customer/session')->isLoggedIn()) {
            $result['redirect'] = $product->getProductUrl();
            return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
        }
    }
}

protected function _createit($type, $doSave = true, $originalProduct, $newImagePath = '')
{
    $res = '';
    $login = '';
    $productId = '';

    $session = Mage::getSingleton('customer/session');
    try {
        $errors = $this->_getCustomerErrors($customer);
        if (empty($errors)) {
            $res = $this->saveProduct($type, $doSave, $originalProduct, $newImagePath);
            $productId = $this->getRequest()->getPost('product_id');

            if (Mage::getSingleton('customer/session')->isLoggedIn()) {
                return $res = $this->saveProduct($type, $doSave, $originalProduct, $newImagePath);
            }
        }
    } catch (Mage_Core_Exception $e) {
    }
}

public function saveProduct()
{
    // Product creation code
}

For "Login" . all 3 steps are working.


texts: Magento 2 : Does redis make any difference on low traffic store

texts:
I've recently come across redis being installed and configured on single server low traffic stores.
Generally the default response for anyone when reporting their Magento 2 store is slow (which is everyone) is for the web hosts to install and configure redis (among other things). However so far it is my personal opinion that having redis adds an additional barrier when trying to load new content and I see very little performance gain.
Knowing a bit about the technology and how it works it is my understanding is that with a webserver using ssd's with low traffic the benefit is minimal. I'm wondering if anyone in the community has some benchmarks on low traffic stores with a before and after to confirm my theory.
I do however understand how redis has a positive impact on high traffic stores.
I'm keen to hear other's experiences. I see questions on configuring redis but I don't seen that anyone has asked this question on magento 2.


texts: the word "UPDATE" causes CMS page not to save Magento 1.9.4.2

texts:
Here's a strange one...

I'm editing my privacy policy page in CMS>pages and copy/pasting the text out of notepad++, then formating with the wysiwyg editor in magento, then cleaning up the html that the editor leaves dotted around.

I copy/pasted all the text and clicked "Save and Continue Edit" and after a pause of a few seconds I am returned to the list of CMS pages - if i then click the privacy policy to edit it again, the changes are not there.

So, i thought there must ba an odd character that i've not spotted, a line to long or some formatting issue that's causing the problem so I began pasting in the text bit by bit until i found the part that was causing it not to save.

when I narrowed that down more and more and even typed the text directly in to the editor rather than pasting it it turns out that the word "update" cause the edit to fail!   "updat" and "updat e" are fine but if I put "update" ANYWHERE on the page, the edit will fail.


texts: Multiple modal popup elements, can't set z-index

texts:
I have two modals that can be opened on the page.
But they both have the same z-index, so I try to set a higher z-index for one of them:

<script type="text/javascript">
    require(['jquery',
        'Magento_Ui/js/modal/modal','mage/validation'],function($){
        myModal.modal({
            responsive: true,
            zIndex: 950,
            ...

But the zIndex: 950, doesn't work at all. I wonder maybe it is some deprecated or undocumented option because the off. docs don't mention it.
https://devdocs.magento.com/guides/v2.3/javascript-dev-guide/widgets/widget_modal.html

Update:
I have found out that here

baseIndex = zIndex + this._getVisibleCount();

_getVisibleCount() returns 0 even though one modal is already open. That's my problem.


texts: Can I set different titles from names of upsell products?

texts:
Can I set alternative names in upsell products list?

I would like to set an attribute "upsell_name" in CSV import so labels in red circles would be altered.

For example for product "Long name param1 param2", I would set "upsell_name" to "param1 param2".


texts: Filter Magento 2 product collection with custom text like Catalog Search

texts:
I am just trying to filter product collection same like catalog search module, but not couldn't get the succeed with this. For this I tried this,

use Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection as SearchColletion;

$collection = $this->searchCollection->addSearchFilter('MY CUSTOM TEXT');

For this I checked vendor\magento\module-catalog-search\Model\ResourceModel\Fulltext\Collection.php to Investigate how it actual works in Magento catalog search, and found that in _renderFiltersBefore() Magento is using filterBuilder, searchCriteriaBuilder and so many things for searching, but couldn't understand properly.

Can someone put some light on this to get the actual result?


texts: Canceled orders not updating in Google analytics

texts: I just noticed that canceled orders are not updating in Google analytics. The canceled orders in Google analytics are still showing the original sales data and revenue amounts but since the orders were canceled they should show as $0 in Google analytics. Has anyone experienced this issue? I'm not sure what to do next to resolve this problem.


texts: How to Structure Newsletter Template content and style

texts:
I was wondering if anyone could confirm whether my assumption of treating the template content area as the "body" bit and thus not including the html and head tags would be correct? or do I need to do include these tags and treat the area just like a blank doc?

Similarly, using the style tag in body is not valid html. Thus, if the head tag is automatically added then how can I include my style tag in there ?


texts: How to call custom jQuery slider in magento 2

texts: Can anyone help me, I am new to Magento 2. I want to call custom jquery slider on home page on my local site. I have tried myself but not getting how to use it with requirejs-config.js. It will be very helpful if you explain from basic step by step.


texts: Product grid says "The resource isn't set" when adding __construct to model class

texts:
I have a model class that I'm trying to inject a ScopeConfigInterface into, and after compiling di, the product grid says "The resource isn't set." My class extends
\Magento\Framework\Model\AbstractModel and implements \Magento\Framework\DataObject\IdentityInterface, \myCompany\myModule\Api\Data\MyEntityInterface.

Errors in  var/system.log:

[2017-03-15 22:36:51] main.CRITICAL: Broken reference: the 'header' tries to reorder itself towards 'global.notices', but their parents are different: 'page.wrapper' and 'notices.wrapper' respectively. [] []
[2017-03-15 22:36:51] main.CRITICAL: Broken reference: the 'page.breadcrumbs' tries to reorder itself towards 'notifications', but their parents are different: 'page.wrapper' and 'notices.wrapper' respectively. [] []
[2017-03-15 22:36:51] main.CRITICAL: Broken reference: the 'global.search' tries to reorder itself towards 'notification.messages', but their parents are different: 'header.inner.right' and 'header' respectively. [] []
[2017-03-15 22:36:51] main.CRITICAL: The resource isn't set. [] []

The only thing I've added to the class is the new __construct() code.  Here is my code.

protected function _construct() {
    $this->_init('\myCompany\myModule\Model\ResourceModel\MyEntity');
}

public function __construct(
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
) {
    $this->_scopeConfig = $scopeConfig;
}


texts: popup contains checkbox to get feedback when remove items in minicart

texts:
I need to popup contains a checkbox to get feedback on why user remove item/s in mini cart and save result in the database in Magento2
Can you help me?


texts:
I'm trying to execute a custom js on a product page in a way to get an color swatch selected on page load only if there is only one option. This is the script:

var number = $('.swatch-attribute .color').length;
if(number==1){
    $('.swatch-attribute .color').click();
}
});

In the console it works but not in Magento, how can I handle it?


texts: How to get street address in customer edit form

texts:
Currently, I am in the customer address form

block

\Magento\Customer\Block\Address\Edit $block

How to use $block and get the street address of the customer address.
I tracked the street address is stored in customer_address_entity table in the street column.


texts: Magento 2 add custom tab in customer edit section and save data

texts:
I am able to add custom tab customer edit section when they click on it i am showing one form by using protected function _prepareForm() { this function form is showing but when i change data in that form after that i click on save and continue data not sending to controller and i am unable to save data any solution how to save data

https://webkul.com/blog/tab-with-form-in-admin-customer-edit-magento-2/

     protected function _prepareForm() {

            if (!$this->canShowTab()) {
                return $this;
            }
            $customer = $this->getCustomer();

    //        $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORES;
    //        echo $this->_scopeConfig->getValue("cms/wysiwyg_config", $storeScope);
    //        print_r($customer->getData());

            /** @var \Magento\Framework\Data\Form $form */
            $form = $this->_formFactory->create();
    //        $form->setHtmlIdPrefix('pawan_');
    //        $form->setFieldNameSuffix('pawan');

            // start connect pro form //
            $fieldset = $form->addFieldset(
                    'base_fieldset', ['legend' => __('CUstome')]
            );

            $fieldset->addField('connectcheck', 'checkbox', array(
                'label' => __(' Enable/Disable'),
                'name' => 'connectcheck',
                'checked' => ($attr == 1) ? true : false,
                'onchange' => "checking()",
                'value' => '1',
                'disabled' => false,
                'after_element_html' => '<small>Active or Deactivate module for frontend</small>',
                'tabindex' => 1,
                'data-form-part' => $this->getData('target_form'),
            ));
$this->setForm($form);

        return parent::_prepareForm();
    }

Getting error on checking() undefined .I tried adding

 $fieldset->setAfterElementHtml('
                                <script>
                                require(["jquery"], function(jQuery) {
                                function checking()
                                    {
                                            alert("hererere");
                                    }
                                    });
                                                                   </script>
                            ');

can any one tell me how to write on change in block


texts: Magento 2 : Any Script or Extension to Attach Product Images to SKU

texts:
I am looking a script or extension to do this:
I upload products via CSV, then run script or extension and attach product images (multiple) to the SKU, easy and fast and don't have to write in csv like a mule

I have 1000 products 10.000 images in this file path structure and products are in Magento 2 but without images attached to product

/(SKU)/*.jpg (1,2,3,4,5,6,7,8,9).jpg

example:/coffeecup/1.jpg, coffeecup/2.jpg, etc

this extension is for Magento 1, but i need any like this for Magento 2: https://marketplace.magento.com/nanowebgroup-nanowebgroup-imageimporter.html


texts: implement rel="next and rel="prev" magento 1.9

texts:
im trying to get a paginated tags as rel="next" and rel="prev" for SEO reasons,
but i cant figure it out
ive tried this code in the head.phtml:

<?php
$actionName = Mage::app()->getFrontController()->getAction()->getFullActionName();
if ($actionName == 'catalog_category_view') // Category Page{
$category = Mage::registry('current_category');
$prodCol = $category->getProductCollection()->addAttributeToFilter('status', 1)->addAttributeToFilter('visibility', array('in' => array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG, Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)));
$tool = $this->getLayout()->createBlock('page/html_pager')->setLimit($this->getLayout()->createBlock('catalog/product_list_toolbar')->getLimit())->setCollection($prodCol);
$linkPrev = false;
$linkNext = false;
if ($tool->getCollection()->getSelectCountSql()) {
  if ($tool->getLastPageNum() > 1) {
      if (!$tool->isFirstPage()) {
          $linkPrev = true;
          if ($tool->getCurrentPage() == 2) {
             $url = explode('?', $tool->getPreviousPageUrl());
            $prevUrl = @$url[0];
        }
        else {
            $prevUrl = $tool->getPreviousPageUrl();
        }
    }
    if (!$tool->isLastPage()) {
        $linkNext = true;
        $nextUrl = $tool->getNextPageUrl();
      }
   }
 }
 if ($linkPrev) echo '<link rel="prev" href="' . $prevUrl . '" />';
 if ($linkNext) echo '<link rel="next" href="' . $nextUrl . '" />';
}
?>

but for some reason its not showing any thing in the view source page.

please help im Frustrated.


texts: How not to use ObjectManager in phtml from template

texts:
First a bit of context, and at the end, my question

I added an EAV attribute to my customer. It's an attribute with multiple values, and I want to add it to the account information (for reasons).

I've made a module, added a source for my select element, observer, etc...

It's working ok.

Let's say it's in

app/code/MyCompany/MyEAVAttributeModule

I've got a custom theme, made by another team, in

app/design/frontend/ThemeTeam/ThemeInUse

To add my attribute to the register and edit form, I've added on the custom theme

app/design/frontend/ThemeTeam/ThemeInUse/Magento_Customer/templates/form/register.phtml

and

app/design/frontend/ThemeTeam/ThemeInUse/Magento_Customer/templates/form/edit.phtml

which are copies from

/vendor/magento/module-customer/view/frontend/templates/form/register.phtml and edit.phtml

And to get all my values to add a select element, I've added in the phtml

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$my_attributes = $objectManager->create('Magento\Eav\Model\Config')->getAttribute('customer', 'my_attribute');

if ($my_attributes->getSource()) {
    $my_attribute_list = $my_attributes->getSource()->getAllOptions();
}

and then a <select> and a foreach

It works, my attribute is shown, the value is saved.

Now, for my question :-)

To get all the values, I get an instance of ObjectManager at the begining of my phtml

I know it's wrong to do that, but I couldn't find another way.

So how to do it ?

I know I should make a function and use a Helper (which I read is not recommended) or perhaps use it in the Block ?

But where ? In the theme ? In my module ? Somewhere else ?

Thanks if you can guide me on this one !


texts: Would your recommend Magento CE for installing on Windows 8.1 OS

texts: I have laptop with Windows 8.1 (64 bit) running. Now I want to develop an e-commerce website for my new start-up which is very small. Whether I can install Magento CE on my laptop with Windows 8.1 (64 bit). If so, from where I can download the CE version? Otherwise will you recommend to change the OS to Linux on laptop? Please suggest.


texts:
I have installed a module which overrides a core class of magento.

class Namespace_Module_Model_Sales_Quote_Address_Total_Profile_Subtotal
    extends Mage_Sales_Model_Quote_Address_Total_Subtotal

As you can see the Subtotal class of sales module is extended.
Now I want to extend

Namespace_Module_Model_Sales_Quote_Address_Total_Profile_Subtotal

I tried some solutions from google but nothing is working.

My main motive is to override function _initItem of class app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php

And want override/remove functionality of function _initItem of Namespace_Module_Model_Sales_Quote_Address_Total_Profile_Subtotal

I am using Magento 1.8.1.0

Please help.

UPDATE

class Namespace_Module_Model_Sales_Quote_Address_Total_Profile_Subtotal
    extends Mage_Sales_Model_Quote_Address_Total_Subtotal
{
    protected $_canAddAmountToAddress = false;
    protected $_itemRowTotalKey = 'rt';
    private $_originalProductPrice = null;

    protected function _initItem($address, $item)
    {
        if ($item instanceof Mage_Sales_Model_Quote_Address_Item) {
            $quoteItem = $item->getAddress()->getQuote()->getItemById($item->getQuoteItemId());
        } else {
            $quoteItem = $item;
        }
        $product = $quoteItem->getProduct();
        $isReduction=false;
        $product->setCustomerGroupId($quoteItem->getQuote()->getCustomerGroupId());

        if ($item->getQuote()->getIsSuperMode()) {
            if (!$product) {
                return false;
            }
        } else {
            if (!$product || !$product->isVisibleInCatalog()) {
                return false;
            }
        }

        if (null === $this->_originalProductPrice) {
            $this->_originalProductPrice = $product->getPrice();
        }

        $profileTypeOption = Mage::helper('module/quote')->getProfileTypeOptionFromQuoteItem($item);
        $profileItem = Mage::getModel('module/profile_item')->load($profileTypeOption);
        $isReduction=false;
        $itemId=$profileItem->getData('profile_type_id');
        if(Mage::helper('core')->isModuleEnabled('MyModule')){
            $isReduction=true;
            if(!$product->getQty())
                $qty=Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
            else
                $qty=$product->getQty();
            $quantityArray=array();
            $totalOccurrence=Mage::getModel('profile/price')->getTotalOccurrence($itemId);
            $totalBags=$qty*$totalOccurrence;
            $reductionPrice=Mage::getModel('profile/price')->getReducedPrice($totalBags,$product->getId());
        }
        if($isReduction)
            $product->setPrice($reductionPrice);
        else
            $product->setPrice($profileItem->getData('regular_price'));
        $product->setPrice($reductionPrice);
        $product->setSpecialPrice(null);
        $finalPrice = $product->getFinalPrice($quoteItem->getQty());
        $item->setPrice($finalPrice);
        $item->setBaseOriginalPrice($finalPrice);
        $item->calcRowTotal();
        $this->_addAmount($item->getRowTotal());
        $this->_addBaseAmount($item->getBaseRowTotal());
        $address->setTotalQty($address->getTotalQty() + $item->getQty());
        return true;
    }

}


texts: Can't change "Welcome message", Logo, copyright

texts:
I am using Magento ver. 2.3.5-p1 and I have trouble changing the "Wellcome message", the logo, and the copyright.
I have managed to change them once by going on the admin page, then Content->Design->Configuration->Edit.
In Header, if I try to change the logo image or the size or the Welcome message, the changes will not appear on the store website.
I also try to change the copyright in Footer with the same result.
Things I've tried:

Save Configuration -> Flush Magento cache - in Admin panel
Save Configuration -> Flush cache storage -> Flush Catalog Images cache -> Flush JavaScript/CSS cache -> Flush Static Files cache - in Admin panel
magento setup:upgrade -> magento setup:di:compile - in terminal

The messages (Wellcome message and the copyright) and the logo are not changing. Why?


texts: Magento 2, How to create API for customer login by using facebook

texts: Using Magento 2.2, API. How to create login/logout into magento by using Facebook. I got user profile info form facebook and I need to use this info to get Get Customer Token.


texts: How to filter collection by OR condition?

texts:
I have two 'Yes/No' attributes created for products in my store. I want to get the product collection of products whose at least one attribute is set to yes. I've searched the web, but many websites mentions OR condition against a single attribute.

For the sake of clearance I'll mention the relevant SQL statement which I want to convert in Magento way,

SELECT * FROM catalog_product_entity WHERE attribute1 = true OR attribute2 = true;

Any suggestions would appreciate.


texts: Magento : How to show data of external api using custom module

texts:
I want to create a custom module in which, I want to fetch some external data using API and show them at home page or any location.

I have API's ready , now i want to fetch data in my custom module and show them in my website.

I have never worked with API in magento. Can any one suggest any link or method so that I can start.


texts:
I am looking for a print option in invoice view page of customer account dashboard.

  We would like for our customers to be able to not only view their
  invoices, but print them as well.

So when a customer goes into their account dashboard and clicks on a available invoice, we want there to be an option to print the invoice for their records.

Over by the return we would like a link that says Print to print the below invoice.


texts:
I'm creating a partial invoice and I'm unable to get the qty invoiced to send it to the payment gateway.

The code I'd written in my model for capture() is:

        if ($order->hasInvoices()) {
            foreach ($order->getInvoiceCollection() as $invoice) {
                foreach ($invoice->getAllItems() as $item) {
                    Mage::log($item->getQtyInvoiced()); // getting qty = 0
                }
            }
        }

also, for the next time I do want to create the invoice then $order->hasInvoices() returning false.

Is the above code is right? Any note on debug the invoice items will be appreciated.


texts: hide or show div based on customer logged in or not Magento 2

texts: i want to have a text and a button  in home page when customer is not logged in and when he is logged in this block (div) should be hidden so how to proceed? any help please


texts: How to setup Google Customer Reviews in Magento 2?

texts:
Below is my code-

<?php
/**
* Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

?>
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>

<?php if ($block->getOrderId()):?>
    <?php if ($block->getCanViewOrder()) :?>

<?= __('Your order number is: %1.', sprintf('%s', $block->escapeHtml($block->getViewOrderUrl()), $block->escapeHtml($block->getOrderId()))) ?>

    <?php  else :?>

<?= __('Your order # is: %1.', $block->escapeHtml($block->getOrderId())) ?>

    <?php endif;?>

<?= /* @escapeNotVerified */ __('We\'ll email you an order confirmation with details and tracking info.') ?>

<?php endif;?>
<?= $block->getAdditionalInfoHtml() ?>

        <a class="action primary continue" href="<?= /* @escapeNotVerified */ $block->getContinueUrl() ?>"><?= /* @escapeNotVerified */ __('Continue Shopping') ?>


texts: Magento2: How to set minimum order amount for specific group

texts:
I have created some customers group.

How to set minimum order amount only for specific group?


texts: Categories not showing in navigation bar of first multi website magento installation

texts:
I have multi website magento installation. Made two websites

Both are running on separate sub domains. But however only dropshippingstore website is showing categories in the navigation bar not the retail website for customers . But I have assigned same root category to both.

Site 1 navigation menu

No sub categories showing here.

Whereas in second website sub categories are showing in navigation bar.


texts:
When I run the Order export to CSV from the Order Grid I'm getting a random character "Â" before the "£" symbol.

I can't find the file that outputs the code for the CSV export, I'd imagine I just need to edit the encoding or something simple but I'm unsure what file to edit.
The code from the Order Grid is:

$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));

Where do I find */*/exportCsv?


texts: Is there a way ,or some steps which ensure any custom module/code written in Magento is adhering to all standard/best practices, without it breaking Magento in any case i.e upgrades,extension conflicts etc.


texts: Development Site is Redirecting to Live Site, Even After Setting base-url

texts:
I have just set up a client live site to my development server and change the config live site URLs to my test server URL under core_config_data table i also have all the cache deleted but when i open my development server URL the site is keep going to live site i have tried opening the admin its going to live site too .htaccess has nothing in it for this redirection site using varnish cache.

Any one having any idea what i am missing.


texts: Magento 2.0 multi domain/storeview setup

texts:
I have a blank Magento 2.0 setup and want to create one website with 2 stores, one of them with
2 storeviews and the other store with just one store view. Most important: All of these 3 storeviews shall
share their cart contents, login, etc.. Stores just have different categories. Just like this figure shows:

Website frontendbase on m1.local

Store 1: Storeview m1
Store 1: Storeview m2
Store 2: Storeview m3

Now, when I browse to m1.local , m1 from store 1 displays, perfectly. There is a drop down button at the top
right corner, providing a link to the second storeview m2. Clicking that link creates a POST request to /stores/store/switch
which then redirects me with a 302 status code to m1.local again, showing me the m2 storeview.
At the very bottom of the page, I see another dropdown button providing a link to the other store. Clicking that
does the same as above and takes me to storeview m3. I can sign in in any storeview, add products to the cart, and I can switch
between stores and storeviews as I like, no problem.

Now I want the storeviews to run on separate domains. So, in the backend's store configuration, under General > Web, I set the following things:

Default config

Auto-redirect to Base URL: No

Storeview m1

Base URL: http://m1.local/
Base Link URL: {{unsecure_base_url}}

Storeview m2

Base URL: http://m2.local/
Base Link URL: {{unsecure_base_url}}

Storeview m3

Base URL: http://m3.local/
Base Link URL: {{unsecure_base_url}}

I modify /index.php and /pub/static/index.php in the following way:

$params = $_SERVER;
$domain2store = array(
    'm1.local'=>'m1',
    'm2.local'=>'m2',
    'm3.local'=>'m3',
    );
if(isset($domain2store[$_SERVER['HTTP_HOST']]))
    $storecode = $domain2store[$_SERVER['HTTP_HOST']];
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = isset($storecode) ? $storecode : '';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

Cache cleared, all indexes flushed.

Now, when I browse to m1.local I can switch to the other storeviews as above. But, like randomly, I get static resources loaded from
a different domain than I am on with the main request. E.g. I am on m1.local, but css + image files get loaded from m2.local. Also, the
storeview drop down button does not work any longer as expected. Sometimes it takes me to the right domain, sometimes to the wrong one.
Also, when I sign in with a user/password, I am no longer signed in after switching to another storeview.

I am running the same setup on a) Debian, Apache 2.2, PHP 5.6 and on b) Windows 7, Apache 2.4, PHP 5.5 . Both show exactly the same
problems when I configure different domains per storeview.

I went through quite a few tutorials for setting up a multi-domain, beginning with the documentation on
http://devdocs.magento.com/guides/v2.0/config-guide/bootstrap/mage-run.html
Most pages just suggesst different approaches for assigning the right run code to  $_SERVER['MAGE_RUN_CODE'].

I must be missing something else, or?

=== Edit ===

In the meantime I figured out that a shared cart only works if the user logs into his account. So, the basic question for me is: How do I set up Magento 2 to provide a shared cart without the need to log in?


texts: Quantity adjustments for en_IN locale websites

texts:
When adjusting quantity on the product page or cart page to any quantity, Zend Framework isNumber() function fails to validate the number for numbers passed through in an en_IN locale website. As a result, only a quantity of 1 is ever purchasable. It appears there is a difference in regex used to validate the number between en_US and en_IN.

Someone appears to have logged an issue with ZF however I cannot find any resolution/patch https://framework.zend.com/issues/browse/ZF-12256.

This may also affect other parts of the website which use Zend_Filter_LocalizedToNormalized class.


texts: How can we create a form at front-end using UI component Magento 2

texts:
I am looking to create a form at storefront using UI component. When I create xml file in Ui component folder It throwing an error

Fatal error: Call to a member function getRequestFieldName() on null in /opt/lampp/htdocs/magento2.1.7/vendor/magento/module-ui/Component/Form.php on line 61

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">

</form>

For Now I just have created a simple form tag to check the working. So, I just want to ask, do Magento allow to create a UI form at storefront.
If yes then what do I need to do. I am on Magento 2.1.7.


texts: How to add a new page to the new link in the Customer Account page

texts:
I already add a new link "Demo link" in the Customer Account page, but I still do not know how to add a page to that link

I just learned about Magento 2, can you give detail instructions on each step for me

I also created the file index.phtml to control that link but it does not load the page as I did

I want it to display like this, sidebar and content beside

But when I click on "Demo link" it does not Extend Customer page, exactly **menu sidebar*


texts: Magento 2: How to remove code from html?

texts:
I need remove from the page checkout this:

The code of this html is the next:

    <input type="checkbox" name="billing-address-same-as-shipping" data-bind="checked: isAddressSameAsShipping, click: useShippingAddress, attr: {id: 'billing-address-same-as-shipping-' + $parent.getCode()}"/>

<fieldset class="fieldset" data-bind="visible: !isAddressDetailsVisible()">

            <button class="action action-update" type="button" data-bind="click: updateAddress">

            </button>
            <button class="action action-cancel" type="button" data-bind="click: cancelAddressEdit">

            </button>

</fieldset>

The path:

  app\design\frontend\Smartwave\porto\IWD_Opc\web\template\billing-address.html

I need just remove the next line:

     <input type="checkbox" name="billing-address-same-as-shipping" data-bind="checked: isAddressSameAsShipping, click: useShippingAddress, attr: {id: 'billing-address-same-as-shipping-' + $parent.getCode()}"/>

I have tried to erase it again and again but the change is not reproduced. If I delete the file it does not work so this is the file to edit...


texts: Magento 2 - All Products Page with filters and Pagination

texts:
I need to create a page where product collection from all categories or you can say from root level category (Default Category) generally it has id 2.

I need to make sure that the page is look like normal category where filter can be applied on product collection like brand, color and size etc and all toolbar related functionality sortby, pagination etc

I want to figure out the best approach how it can be done?

P.S: I don't need a solution like make new category and attach all category products to it.

Any help, experience and knowledge sharing would be appreciated.


texts: How to install "stripe-php" library manually for stripe extension?

texts:
I would like to use the free stripe extension from Inchoo for my magento2 store in production.
I did not yet find out how to install the needed "stripe-php" library manually? I do not want to install that module with composer, but install everything manually.

This is the extension im talking about: https://github.com/Inchoo/magento2-Inchoo_Stripe

Where do i have to place the stripe-php folder library if I install manually?
  thanks alot!


texts: How can I get the selected value in the multiselect dropdown?

texts:
I have a three table in my database, article category and art_cat

article has the id,name,status of the article

category has id,name,status of the category

art_cat has id,art_id and cat_id in the tables.

I have the values inserted respectively, but in my "article form" my category values are not coming selected. I have a multi select dropdown for the category.
I have a distinct form for "category". that means my "article form" data goes in article table and "category form" data goes in art_cat table.

$fieldset->addField('category_id', 'multiselect', array(
          'label'     => 'Category',
          'name'      => 'category_id[]',
          'values'   => Mage::helper('blog')->getCategoryOptionValues(true),
          'disabled' => false,
          'index' => 'category_id',
          ));

and here is my helper file Data.php

static function getCategoryOptionValues($inlcudeNone = false) {
    $collection = Mage::getModel('blog/blog')->getCollection();
    $values = array();
    if ($inlcudeNone){
        $values[] = array('label' => "--None--", 'value' => 0);
    }
    foreach ($collection as $category) {
        $values[] = array('label' => $category->getName(), 'value' => $category->getId());
    }
    return $values;
 }

How can I get the selected value for the category multi select dropdown.
Please somebody help me with this.


texts: Magento2.2.0: Generate custom Order attribute to show in Checkout and whole Order Process

texts:
I need to generate custom order attribute dynamically, I have gone through all the core module of magento 2 and try to understand the working of attributes for products and customers, but got no clue to generate attributes in the same manner as products and customers in eav_attribute table.

I got some articles on generating attributes for order but those are not satisfactory , as they are suggesting to add a custom column in sales_order table.

Magento2 Adding Custom Order Attribute

What if I want to generate multiple order attributes?

Thanks.


texts: Trying to login customer after registration, Customer logged in but page refresh destroy session

texts:
Here is proper explanation of Issue that I am facing on Magento 1.9.2.4

I have made custom popups to register and login customer, I have put extended Mage_Customer_AccountController class from my custom module, and simply register customer and login him after it. not more complex customizations.

But I face one issue, I register and login customer successfully, but after receiving ajax response I refresh browser page, and I found customer is not logged in. I have checked customer status right before $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response)); and I verified customer logged in. but some how browser refresh is not showing customer is logged in.

I tried above code in fresh Magento 1.9.2.4 with sample data and with cache disabled. I face same issue.

I think issue is with session instance. To find out session validation, when I put form_key input in my forms and trying to validate, it fails. key value change in my controller action.

My form html input form_key : <input name="form_key" type="hidden" value="B6cegiWPPdruA83H">

and I am verifying it using this in controller action method: Mage::log(Mage::getSingleton('core/session')->getFormKey(), null, "popups.log", true);
I found value is different here: bH60GsLwgJHT6gyC

I tried above method to verify session instance, I am not sure why it changes on for ajax requests.

so I think session is not persistent, I log in customer in session, and when I refresh browser page, May be new session is created and I lost customer login.

registered customer with my custom forms, can login with normal Magento login form.

can somebody please help me with this ? I am sure I am missing something, but not sure about that. I can post controller methods which I use to register and login customer.


texts: How can I create a new order state in my module on Magento 2?

texts:
I'd like to create a new order state like processing, complete and etc.. Using my custom module (without using the admin panel).

How can I do that?

Thanks


texts: How to load multiple id's for products in magento 2 using objectManager?

texts:
I want to load array(2,6,7) of products id's using objectManager and
get details of the product. I found most of the Magento-1.9 solutions.
Is there anything for Magento 2?

I found this,

<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection */
$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
/** Apply filters here */
$collection = $productCollection->addAttributeToSelect('*')
            ->load();

foreach ($collection as $product){
     echo 'Name  =  '.$product->getName().'<br>';
}
?>

but how to load my array product ids?