texts: Magento 1.7.0.2 on PHP 5.6 is not loading

texts:
I am trying to upgrade my PHP version to 5.6.1 to get PCI DSS compliance certificate.

We compiled and enabled 5.6.1 on server and used it with an ApplicationHandler in .htaccess file.

On the same server for the subdomain DEV it worked without any problems. PDOs were a bit problematic but we handled to add the correct PDOs to PHP library.

Just some deprecated function usage errors which are easy to fix, but when I try to add it to live version via .htaccess it did not work at all. All I see is a blank page. No error messages, no reports, no logs, nothing. Just a blank page is welcoming me.

I checked all the enabled Extensions, they all are same.

I searched a lot on web to find some similar cases, came out nothing. I am all empty handed on the issue and I need to make it work.

If there is any body who experienced such a problem please let me know.


texts: Magento 2.3 catalog frontend product listing sort by position

texts:
I have category and i want to sort it by position in ascending order but somehow it is not working on the front end.

Following is my XML

<referenceContainer name="content">
        <referenceBlock name="category.products.list">
            <action method="setDefaultDirection">
                <argument name="dir" xsi:type="string">asc</argument>
            </action>
        </referenceBlock>...

I also change the position in category but it is all the same

Any help would be apprciated. :)


texts: Magento1.9: Customer Account Information Edit Form Admin Dashboard

texts: Where can i find the template form for this account information Tab magento 1.9?


texts: Magento 2: Use a custom controller as website root?

texts:
I'm building a little module on magento2 and I can currently access it at mysite.com/test/mymodule. I want to be able to access it at mysite.com.

How can I do that?

I've tried doing a URL rewrite in the admin panel but it didn't work, I either get the 'too many redirects' error when I put '/' as the request path, and nothing happens when I put '\' like another thread suggested.
I've also searched how to do it by modifying my XML, with no success.

Can you help me ?


texts: How can I get the value of array object?

texts:
Im try to pass sql query value as  an AJAX request, It have a array object I need to pass only the value, below code for that

public function execute()
    {
$resultJson = $this->resultJsonFactory->create();

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();

        $sql = "SELECT price_component FROM base_price WHERE width =".$this->getRequest()->Width." AND height =".$this->getRequest()->Height;
        $result = $connection->fetchAll($sql);
        return $resultJson->setData($result);
    }

if I used below code in .phtml class

.done(function(data) {
                    console.log(data);
                });

result will be like below

[{…}]
0
:
{price_component: "122"}
length
:
1
__proto__
:
Array(0)

If i use result[0] index it will be like JSON object like below

{price_component: "132"}
price_component
:
"132"
__proto__
:
Object

  I just need to get value to the console how can I do that


texts: CatalogSearch is not working after upgrading to Magento 2.3

texts:
Recently I've upgraded from Magento 2.2 to Magento 2.3.

After upgrading, CatalogSearch is redirecting to Home page of the website.

Previously I /catalogsearch/result was working and shown all products.
Now, it's just redirecting to home page

There is no exception in exception.log and no entry on debug.log.

Any idea what's happening?

EDIT

Just now, I've checked advanced search URL catalogsearch/advanced and it is working too. Only the basic search is not working.


texts: Modifying the custom controller url to SEO friendly in Magento 2

texts:
I have created my custom module for loading the custom template.

Here is the code of Vendor/Module/etc/frontend/routes.xml

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

then Vendor/Module/Controller/Index/Index.php

<?php

namespace Vendor\Module\Controller\Index;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
class Index extends \Magento\Framework\App\Action\Action
{

    public function execute()
    {
        $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();
        $this->_view->renderLayout();
    }
}

Vendor/Module/view/frontend/layout/customname_index_index.xml

<referenceContainer name="content">
            <block class="Vendor\Module\Block\Index\Index" name="customname_index_index" cacheable="false" template="Vendor_Module::customname_index_index.phtml"/>
</referenceContainer>

So here my question is to view my template file, I am forming url like below.

website.com/customname/index/index/

Here i am looking for how to make the url as seo friendly?

Is there any possibility to achieve this?

Anyone can look into it and update your thoughts. Thanks


texts:
I am writing an admin module. I created a collection and if the number of rows in the table are small it loads fine. Ultimately the table will have 250k rows in it and when I attempt to load the collection it exhausts memory. I was under the impression that Magento would lazy load collections. I also will probably need to know how to use the resource iterator in mage 2 as well. I can provide code samples but there is little more than a basic module skeleton at this point. I would greatly appreciate a code example of how to handle and iterate through a large collection.

Note: the collection is pulling from a custom table

Controller:

<?php
namespace Customer\Customerimportexport\Controller\Adminhtml\Import;

use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Customer\Customerimportexport\Model\WebcustomersFactory;

class Index extends \Magento\Backend\App\Action
{

    protected $_modelWebcustomersFactory;

    public function __construct(
        Context $context,
        WebcustomersFactory $modelWebcustomersFactory
    ) {
        parent::__construct($context);
        $this->_modelWebcustomersFactory = $modelWebcustomersFactory;
    }

    public function execute()
    {

        $webcustomersModel = $this->_modelWebcustomersFactory->create();

        // Get webcustomers collection
        $webcustomersCollection = $webcustomersModel->getCollection();

        // Load all data of collection
        foreach ($webcustomersModel->getCollection() as $key => $webcustomer) {
            var_dump($webcustomer->getData());
            die();
        }

        $this->_view->loadLayout();
        $this->_view->renderLayout();
    }

}

Model

<?php

namespace Customer\Customerimportexport\Model;

use \Magento\Framework\Model\AbstractModel;

class Webcustomers extends AbstractModel
{
    /**
     * Define resource model
     */
    protected function _construct()
    {
        $this->_init('Customer\Customerimportexport\Model\ResourceModel\Webcustomers');
    }
}

Resource Model

<?php

namespace Customer\Customerimportexport\Model\ResourceModel;

class Webcustomers extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
    /**
     * Define main table
     */
    protected function _construct()
    {
        $this->_init('web_customers', 'entity_id');
    }
}

Collection

<?php

namespace Customer\Customerimportexport\Model\ResourceModel\Webcustomers;

use \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection;

class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
    /**
     * Define model & resource model
     */
    protected function _construct()
    {
        $this->_init(
            'Customer\Customerimportexport\Model\Webcustomers',
            'Customer\Customerimportexport\Model\ResourceModel\Webcustomers'
        );
    }
}


texts: Special Order date picker that validates time frame before add to cart

texts:
I am fairly new to magento2 and I am working on developing a date picker that validates if a special order can be placed in time. The time frame would be different for each manufacturer on the site and can take two types (Regular order 16 weeks, Rush Order 10 weeks). I am kind of stuck in where to start developing this.

Here is an example

http://abrideschoice.com/product/maggie-sottero-trudy-marie-bridal-gown/


texts: How to get category information for a single product in Magento2

texts:
I have an item, i.e. with ID=5.

This product is in Category 1, which is named "Category 1".

I want to get the category name by using the ID, or the SKU of Product with ID=5.

How can I do that?

$_item->getCategory() doesn't work, unfortunately.

Thanks


texts: How to add scroll in bundled product custom options?

texts:
I have created one bundled product and I have added 9 sub-products in this product

Refer below screenshot for all sub-products:

I want to add a scrollbar when the no. of sub-products are greater than 7. So how can I achieve this?

Below file is for bundle product:

  app/design/frontend/Vendor_name/mytheme/Magento_Bundle/templates/catalog/product
   /view/type/bundle/options.phtml

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

// @codingStandardsIgnoreFile

?>
<?php /** @var $block Magento\Bundle\Block\Catalog\Product\View\Type\Bundle */ ?>
<?php
$product = $block->getProduct();
$helper = $this->helper('Magento\Catalog\Helper\Output');
?>
<?php $options = $block->decorateArray($block->getOptions()); ?>
<?php if ($product->isSaleable()):?>
    <?php if (count($options)): ?>

        <fieldset class="fieldset fieldset-bundle-options">

<?php echo __('Test Products'); ?>

            <?php echo $block->getChildHtml('product_info_bundle_options_top');?>
            <?php foreach ($options as $option): ?>
                <?php if (!$option->getSelections()): ?>
                    <?php continue; ?>
                <?php endif; ?>
                <?php echo $block->getOptionHtml($option) ?>
            <?php endforeach; ?>
        </fieldset>
    <?php else: ?>

<?php /* @escapeNotVerified */ echo __('No options of this product are available.') ?>

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

NOTE: I want to add scroll programmatically  without using any CSS style


texts: How to disable a product using Id in phtml?

texts:
I need to disable a product which is added by specific role. My code below:

    $role_id = 1 ; //get user's role id from system configuration
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $adminSession = $objectManager->get('Magento\Backend\Model\Auth\Session');
     $current_adminuser =    $adminSession->getUser()->getRole()->getRoleId();
    if($role_id == $current_adminuser): ?>
    <?php
require __DIR__ . '/app/bootstrap.php';

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

$obj = $bootstrap->getObjectManager();

$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('adminhtml');

$product = $obj->get('Magento\Catalog\Model\Product')->load(1);
$product->setStoreId(0); // you can set store id here
$product->setStatus(2); // 2 => Disable , 1 => Enable
$product->save();

This returns fatal error because of bootstrap.php file. Else can I disable produc using product id with raw sql?


texts:
Don't show swatches on product listing magento 1

In the settings everything turned on

Attributes are also all set up correctly.


texts: Auto category-hide if no products present

texts:
Is it possible to automatically hide/unhide a category depending on whether there are products in it to display or not?

i.e. if all products sell out, then the category disappears, and vice versa, if a product comes back into stock, then the category automatically re-appears on the site.


texts: Magento 2, new widget with image chooser parameter, does not save picture

texts:
I create a new widget and one of the parameters is a picture chooser, I just use this  code. Everything looks well. I can open media folder and choose the picture I want to use. When I choose the picture, the picture field on the form is filled with this value:

  http://local.magento.com/admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvcHVycGxlLmpwZyJ9fQ,,/key/4c150d984998702b74709bb8f05820aff2f85a968d47e50f9638b7d2a7b1ced3/

But when I save the form widget data, the picture field has this value:
{{media url=

nothing more. How can I solve this?


texts: Magento 2.3 search results relevance with elasticsearch?

texts:
Magento 2.3 integrated with Elasticsearch 5.2 provides search results similar to Mysql search in terms of relevance. For example a keyword Pink, search output is 126 items found both in Mysql and Elasticsearch.

Isn't elasticsearch supposed to provide more relevant results? When an extension like Wymoind or Amasty elastic search extension is added, then the results for Pink keyword narrows down and looks more relevant which results in 31 items.

Is this how it is supposed to work or am I missing something? I know for sure elasticsearch is working because when turn off the server and do a search, I get node not found exception.


texts:
I'm trying to add an product tab which only functions as a link href predifined in a custom block. No tab content is needed.

I tried the following:

        <referenceBlock name="product.info.details">
            <block class="Customvendor\Custommodule\Block\Product\View\Customtab" name="product.tabs.custom" template="Customvendor_Custommodule::product/view/tab.phtml"/>
        </referenceBlock>

With which tab.phtml contains the clickable button html and the link which it gets from the customtab block.

However the only thing it outputs is a tab without a title/name, and the content of tab.phtml outputted in the content area below the tabs when you click on it.

If anyone could help me further with this it would be much appreciated!


texts: Order Comment Just before Place order Magento 2

texts:
Is Default Magento 2 provide an order comment option just before placing the order?

If not someone suggests me a good plugin or any custom method to do.


texts: Magento 2 | Use input text as a filter in layered navigation

texts:
I try to explain what I would like to do:

I created a new attribute called stockqty in Stores> Attributes> Products.
I assigned this attribute to the Default section and re-indexed everything
As a last step I have assigned a certain number of quantities for each product. Example: Product-X will be with "stockqty = 100", Product Y will be with "stockqty = 200" etc ...

When I go to the list page I dress that my attribute is correctly displayed in the layered navigation but not as I want:

In this filter I don't want to see the checkboxes but a single input text in which I put a quantity and after sending I would like to see the products that fall within the quantity that I wrote.
How can I accomplish this?


texts: product price based on gold price or gold weight in magento 2

texts:
Hi guys,

I am a newbie to Magento and i'm Developing a Jewelry store with Magento 2.

In which i need to set product price based on gold price, making charge, gold weight etc. (No fixed prices, price depends on day to day gold price)

In order to get this i need to set a price formula. So my question is
1. Is it possible to calculate price based on product attributes ?
2. If So, how can i do this ?

Please help me to achieve this ?


texts:
I want to display CMS block names (for example, footer links, promotional banners, etc.) and display modes (for example, products only, static block only, static block and products) in the admin form dropdown.

In Magento 1, I have displayed it using the following code:

Display mode:

'values'=>Mage::getModel('catalog/category_attribute_source_mode')->getAllOptions() display mode

CMS block

'values' => Mage::getModel('catalog/category_attribute_source_page')->getAllOptions()

What is the equivalent code for the above in Magento 2 for getting the CMS block name and display modes in the admin form dropdown?


texts: displaying store address in transactional emails with line breaks

texts:
I can get the store contact address to display in the transnational emails using {{config path="general/store_information/address"}}
but the address is displaying without any line breaks, I've look everywhere but I can't find how to display the address with the proper line breaks


texts: magento 2, I need to add dompdf Library Without using composer in my extension

texts:
I have created an extension for HTML to PSD by using dompdf Library.

I had tried to using composer and it's working fine.

But I need this Library in my custom extension. When any user add extension
directly, it will working fine.

Please let me know proper suggestion with some demo code.


texts: Options and price is not coming to Configurable product in magento 2

texts:
We have configurable product with child product.

If we are enabling product for Pre-order with all child product. then price is not showing at front end and options are not coming to drop down.
For more clarity attaching screen-shot.

Thanks in advanced


texts: How to wrap multiple elements in a div - Magento 2

texts:
I'm trying to separate the checkout fields into divs but in this module, I found that the HTML template doesn't exist.

I'm using this link Checkout Form - How to wrap multiple elements in a class - Magento 2

But get the error: Template not found.
This is my repository with module complete for anyone see:
https://bitbucket.org/israelguido/custom_checkout_m2/src/master/


texts: How to add custom field to Checkouts Total Sort Order?

texts:
I need to add my custom item to Checkout Total Sort Order in configuration page. I created custom price, which shown in checkout according to this manual https://indiestechtips.wordpress.com/2011/07/30/how-to-add-custom-field-in-the-billing-and-shipping-address-of-onepage-checkout-in-magento/
Difference only in that my custom field is calculated via math formula. So now, having new field in checkout, I need to add this field to Checkout Total Sort Order. Question is that how to do this ?


texts: How to call CURL in magento 2 for curl_getinfo($ch, CURLINFO_HEADER_SIZE)

texts:
$ch = curl_init($url);
    $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);

How to call in magento 2.  I tried

    $this->_curl->setOption(CURLINFO_HEADER_SIZE);


texts: What is mean by oAuth type "access" or "verifier" in Magento2?

texts:
In oauth_token table, what/how records are associated with "consumer_id" or "admin_id" ? I created a profile in system > integration , and that recordd has consumer_id but not admin_id

Also, what's  the meaning of "type"? I see on my table , there are both "access" & "verifier".


texts: Magento 2 moving top.search block before minicart

texts:
I seem to being having an issue with moving referenceblocks.

I have created a child theme based off of Blank. In my default.xml file, I moved both minicart and top.search blocks into header.panel like so

<move element="top.search" destination="header.panel" before="minicart" />
<move element="minicart" destination="header.panel" after="top.search" />

but I can't get the minicart to be after the top.search. Can someone help me? Below is a screenshot of how it looks once I moved it.


texts: Invalid Digital Receipt Delivery URL in MIGS integration

texts:
Getting Error on the integration of MIGSusing PHP

Please Help

Getting Error
Invalid Digital Receipt Delivery URL


texts:
How to add bundle product to cart automatically with addproduct method , without customization page ,
help me please or.
Is it possible ?


texts: Magento 2 - Unable to change category products position

texts:
In Magento 2.3.0, I try to change position for category products.

In admin, each position is set but in the frontend, nothing changes. Even after clear/flush cache and reindexing.

Do you know how and in which file makes this change programmatically to get product collection sort by product position set in the category section?

In template file where I display product it's done like this :

        /**
         * Product list template
         *
         * @var $block \Magento\Catalog\Block\Product\ListProduct
         */
        $_productCollection = $block->getLoadedProductCollection();

        foreach ($_productCollection as $_product): ?>

           <!-- HTML code here -->

        <?php endforeach ?>

I try add this before foreach section but it doesn't work :

$_productCollection->addAttributeToSort('cat_index_position', 'ASC');

Also I found this code in catalog_category_view.xml file :

<block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
                    <action method="setSortBy">
                        <argument name="dir" xsi:type="string">date</argument>
                    </action>
                    <action method="setDefaultDirection">
                        <argument name="dir" xsi:type="string">asc</argument>
                    </action>

So I try to remove both <action> blocks, or change date by position but it's not better.

This is the (string)$_productCollection->getSelect() result :

    SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `stock_status_index`.`stock_status` AS `is_salable`
FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id='83'
INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
INNER JOIN `search_tmp_5ec3b7c70e9488_09559138` AS `search_result` ON e.entity_id = search_result.entity_id
INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id
ORDER BY `e`.`entity_id` DESC

Thanks


texts: My Custom Module is redirecting to 404 page in Magento2 CR2

texts:
I develop one custom module but its redirecting to 404 page and also it not create my custom table (once i run upgrade cli it will make entry in config.php and set) but its work fine on beta version
below are the i used please correct me where i did mistakes

app\code\Sugarcode\Test\registration.php

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

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Sugarcode_Test',
    __DIR__
);

app\code\Sugarcode\Test\composer.json

{
    "name": "sugarcode/module-test",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/module-config": "100.0.*",
        "magento/module-store": "100.0.*",
        "magento/module-backend": "100.0.*",
        "magento/module-customer": "100.0.*",
        "magento/module-cms": "100.0.*",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-module",
    "version": "100.0.1",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Sugarcode\\Test\\": ""
        }
    }
}

app\code\Sugarcode\Test\etc\module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Sugarcode_Test" setup_version="2.0.6" />
</config>

app\code\Sugarcode\Test\etc\frontend\routes.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    <router id="standard">
        <route id="test" frontName="test">
            <module name="Sugarcode_Test" />
        </route>
    </router>
</config>

app\code\Sugarcode\Test\Controller\Index\Index.php

class Index extends \Magento\Framework\App\Action\Action
{
        /**
         * @var \Magento\Framework\View\Result\PageFactory
         */
        protected $resultPageFactory;

    /**
     * @param \Magento\Framework\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory resultPageFactory
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }
/**
 * Default customer account page
 *
 * @return void
 */
public function execute()
{
    echo 'Hello'; exit;
    return $this->resultPageFactory->create();
}

}

i exit in action but its not exiting it show 404 error page

url is domin.com/test

can any one help me on this


texts: Call to a member function getBackend() on a non-object while setting special price to null

texts:
I am trying to change the products prices but when I set special prices to null then it gives me an error "Call to a member function getBackend() on a non-object".
Is there any mistake in my code?

$prod = Mage::getModel('catalog/product')
                        ->setStoreId($storeId)
                        ->load($prodId);
        $prod->setPrice($newPrice)->getResource()->saveAttribute($prod, 'price');
        $prod->setSpecialPrice('')->getResource()->saveAttribute($prod, 'special_price');
        $prod->setSpecialFromDate('')->getResource()->saveAttribute($prod, 'special_from_date');
        $prod->setSpecialToDate('')->getResource()->saveAttribute($prod, 'special_to_date');


texts: Change $this to different block in related.phtml

texts:
I am working in related.phtml in app/design/frontend/[package]/default/template/catalog/product/list/. Here there is a foreach loop: <?php foreach($this->getItems() as $_item): ?> which loops through and outputs the related items of the main product on the page.

I have modified the contents of the loop to display the drop-down configurable options for each related product (if it is a configurable product).
See image below:

Unfortunately, the <option>'s in the <select> drop-downs do not have any value attribute, so when the form is submitted, they have no effect.

The code from configurable.phtml found in app/design/frontend/[package]/default/template/catalog/product/view/type/options/ which loads the configurable options for the main product on the page, uses these lines which runs some JavaScript to add the value's:

<script type="text/javascript">
    var spConfig = new Product.Config(<?php echo $_jsonConfig ?>);
</script>

But adding this directly to my code in related.phtml doesn't have any effect and would probably conflict with the main product, as suggested here. I have followed their advice and used this code

 <script type="text/javascript">
    var spConfig_<?php echo $_item->getId()?> = new Inchoo_Product.Config(<?php echo $this->getJsonConfig() ?>);
 </script>

and made a new namespace with the product.js as suggested, but still this has no effect, and the <option>'s still have no value attribute.

I think the issue is with the $this in the above code, because it is pointing to the wrong class, because this code was originally intended for configurable.phtml NOT related.phtml.

So my question is, how do I change where $this is pointing?


texts: How to add Buy now button at product single page in magento - 1.9?

texts: I have developed one Website on magento-1.9 version. Everything is working fine. Now, i need to add Buy now button additionally beside to the add to cart button at Single product page.


texts: Magento 2 admin session lifetime not extend the time more than 30 mintes

texts:
I have put the session lifetime 84600 at admin side and cookies time same also. but after cleaning cache and again login, it does logout after 30 mints.

Please help me to resolve this issue.


texts: Magento 2 : How to make lastname and email as optional for customers?

texts:
I wanted to make last name and email of customer as optional in admin.
Here is my code

ui_component/customer_form.xml

 <field name="email">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">email</item>
                    <item name="source" xsi:type="string">customer</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                        <item name="validate-email" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>

<field name="lastname">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">customer</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                        <item name="validate-alphanum-with-spaces" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>

And I have changed the attributes "is_require" value 1 to 0 in db table(eav_attribute) , Still i am getting server side validation.

Please check the screenshot

Please help me to resolve this. thanks in advance.


texts:
I am activating a new theme on a page that has a previous premium theme so now when I click on "activate", it shows me this error:

And I have 2 options:

Leave as is
Override

I do not want to lose any of the data/products that I have already on my store. I just want to update the template.

Which option do I choose?


texts: How to Update Custom Product Total Price with Discount

texts:
How to change Product custom price with same product id in Magento.
My Website URL is http://zohard.com/kanzy_new/index.php/customize-bundle/

I have added product in bundle list and apply discount by product added as a position wise discount,I need to update cart price same as total for this bundle.
Thanks in advanced.


texts: magento 2 Use in Layered Navigation option showing backend

texts:
I am using Magento ver. 2.1.4 in Backend I add Attribute it not showing in front end

In Backend Use in Layered Navigation option also not showing in backend


texts: Custom Discount not apply after customer login

texts:
I created the discount programatically by sales_quote_collect_totals_after event.

This discount applies only when cart subtotal greater than 500. This discount works good in cart page. After customer login, this discount is removed automatically.I tried this Refer link, but not working.The below which I used in sales_quote_collect_totals_after event

 $discountAmount = 0;
        $quote = $observer->getQuote();

    $quoteitems = $quote->getAllItems();
    foreach ($quoteitems as $item) {
        /*@var $quoteItem Mage_Sales_Model_Quote_Item */
        $product = $item->getProduct();
        $totalprice += $quote->getBaseSubtotal();
        //exit;

    }

    if($$totalprice>500) {
    $discount = 100;
        $total=$quote->getBaseSubtotal();
        $quote->setSubtotal(0);
        $quote->setBaseSubtotal(0);

        $quote->setSubtotalWithDiscount(0);
        $quote->setBaseSubtotalWithDiscount(0);

        $quote->setGrandTotal(0);
        $quote->setBaseGrandTotal(0);

        $canAddItems = $quote->isVirtual()? ('billing') : ('shipping');
        foreach ($quote->getAllAddresses() as $address) {

            $address->setSubtotal(0);
                $address->setBaseSubtotal(0);

                $address->setGrandTotal(0);
                $address->setBaseGrandTotal(0);

                $address->collectTotals();

                $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());
                $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());

                $quote->setSubtotalWithDiscount(
                    (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()
                );
                $quote->setBaseSubtotalWithDiscount(
                    (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()
                );

                $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());
                $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());

            $quote ->save();

            $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)
            ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)
            ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)
            ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)
            ->save();

            if($address->getAddressType()==$canAddItems) {

                    $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$discountAmount);
                    $address->setGrandTotal((float) $address->getGrandTotal()-$discountAmount);
                    $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$discountAmount);
                    $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$discountAmount);
                if($address->getDiscountDescription() || $address->getDiscountAmount()){
                    $address->setDiscountAmount(-($address->getDiscountAmount()-$discountAmount));
                    $address->setDiscountDescription($address->getDiscountDescription().', Free Samples');
                    $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()-$discountAmount));
                }
                else {
                    $address->setDiscountAmount(-($discountAmount));
                    $address->setDiscountDescription('Free Samples');
                    $address->setBaseDiscountAmount(-($discountAmount));
                }
                $address->save();
            }
        }
    }


texts: List all sub categories names on custom homepage using static block

texts:
I want to show all sub categories names like a menu on my custom homepage pleas e see the image below.

On the right hand side is slider which is coming from custom static block and below the slider there are 3 banners they are also coming from custom static block on the left hands side there is a menu which i want to come from categories currently it is only HTML

EDIT

I want left menu to come from magento sub-categories. from default categories created in admin panel. I want to display those created categories here in below image left hand side.


texts: Magento 1 get product or category id by url string

texts:
I have url string. I need to detect if url belongs to product or category and get product or category id.

I tried this, but it won't work:

  $vPath = 'http://dev.magento186.com/default/example/example3.html';
  $oRewrite = Mage::getModel('core/url_rewrite')
                  ->setStoreId(Mage::app()->getStore()->getId())
                  ->loadByRequestPath($vPath);
  var_dump($oRewrite->getProductId());

It works only if $vPath is path and not full url. Is there any easy way to get product id or category id from full url?


texts: Product Image background color goes to tranparent in Magento 2?

texts:
My original png image for product is

After upload the image the image show on Front end like

It shows like that why my background colour fade out.
Any help is appreciated.


texts: Magento 2.1 Admin panel isn't loading properly

texts:
It shows error we deploy command:

Compilation from source:
adminhtml/Magento/backend/en_US/css/styles.less
Unable to get content for adminhtml/Magento/backend/en_US/Magento_ConfigurableProduct/css/source/module/components/navigation-bar/_navigation-bar.less


texts: Magento 2.2.4: After 'setup:upgrade' command CSS do not load

texts:
I am using PHP Version 7.1.11 with Magento 2.2.4.

Using XAMPP with Windows 8.1

Each time when use setup:upgrade command my CSS get lost and do not load.
Then I have to run static-content:deploy command.
Why this is happening each time, I am working in developer mode still this issue is coming.

I also have gone through some articles in stack overflow but they are not working for me. one of the article has the same issue but still that is not working for me.

Problem setup:upgrade with CSS

Need help in understanding the exact issue.

Thanks


texts: Load Config Collection including config.xml values

texts:
I need to load all configs with some filter, including values, that defined in config.xml files.
Here's some code to make some clarity about what I need to do:
public function __construct(
        \Magento\Config\Model\ResourceModel\Config\Data\CollectionFactory $scopeCollectionFactory
    ) {

        $this->scopeCollectionFactory = $scopeCollectionFactory;
    }

public function loadConfigs(array $configIds = [], $fromId = 0, $limit = 1000): array
    {
        $collection = $this->scopeCollectionFactory->create()->addFieldToFilter('config_id', ['gt' => $fromId]);
        if (!empty($configIds)) {
            $collection->addFieldToFilter('config_id', ['in' => $configIds]);
        }
        return $collection->getItems();
    }

It does not return items that defined in config.xml. How do I achieve that?


texts: Reference to undeclared plugin with name 'stockedProductsFilterPlugin' warning in di compile magento 2.3.2

texts:
I have recently upgraded my site from Magento 2.2.6 to Magento 2.3.2.
During each di compilation it shows a warning like

  main.INFO: Reference to undeclared plugin with name 'stockedProductsFilterPlugin'. [] []

When i debugged this case and i found that in Magento 2.3.0 there was a plugin available with this name in 'module-elasticsearch' module and in Magento 2.3.2 they have removed that plugin and definition from that module. But in the module 'module-inventory-elasticsearch' they are written to disable that plugin which is currently not existing like below.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider">
    <plugin name="stockedProductsFilterPlugin" disabled="true"/>
    <plugin name="stockedProductFilterByInventoryStockPlugin" type="Magento\InventoryElasticsearch\Plugin\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider\StockedProductFilterByInventoryStock"/>
</type>

So since there is no definition for that plugin this warning is showing. So how we can remove this warning from di compile. When i removed the disabling code from this module the warning will gone. But we are not supposed to edit the magento core files. Also another way i found create a dummy plugin with the same name, but this is a bad way. Any other solution for this?


texts: ReferenceError: jQuery is not defined Magento 2

texts:
I created a countdown using JS. For that i need jQuery so I created requireJs file.

var config = {
paths: {
    'countDown': "ABC_CoundDown/js/countDown"
},
shim: {
    'countDown': {
        deps: ['jquery']
    }
}
};

then added jquery in web/js/jquery.js

then in phtml I used


texts: Magento 1.9 Not able to create quote item

texts:
I have the following function inside my model.This checks for the device id(custom column in sales quote) in database and if found and the qoute item has same product id then just updates the qty or else create a new quote.When I use this,It simply is not going to else part.Here is my code.

  public function _create(array $data)
{
    $postParams = $this->getRequest()->getParams();
    $product_id=$postParams['product_id'];
    $qty=$postParams['qty'];
    $deviceId=$postParams['device_id'];
        $collection = Mage::getModel('sales/quote')->getCollection()->addFieldToFilter('device_id',  $deviceId);

foreach($collection as $item)
{

$quote = Mage::getModel('sales/quote')->load($item->getEntityId());
$cartItems = $quote->getAllItems();
foreach ($cartItems as $items) {
$productId = $items->getProductId();
 $qtys = $items->getQty();
if($productId==$product_id){
    $qtys+=$qty;
    $items->setQty($qtys);
    $ks=$items->getQty();
    $items->save();
    }
    else {

        $productModel = 'hello';

    }
}

}

     echo json_encode(array('success' => $productId,'quoteObj' => $productModel)); die;

}

Please help.Thanks

Updated : This code now updates the quantity as well as create a new quote if i pass same product id and device id .If same pid and device id is passed ith should only update not create another one.

public function _create(array $data)
{
    $postParams = $this->getRequest()->getParams();
    $product_id=$postParams['product_id'];
    $qty=$postParams['qty'];
    $deviceId=$postParams['device_id'];
        $collection = Mage::getModel('sales/quote')->getCollection()->addFieldToFilter('device_id',  $deviceId);
        if ($collection->count()) {
            foreach($collection as $item)
{

$quote = Mage::getModel('sales/quote')->load($item->getEntityId());
$cartItems = $quote->getAllItems();
foreach ($cartItems as $items) {
$productId = $items->getProductId();
 $qtys = $items->getQty();
if (! $quote->hasProductId($product_id)) {

$productModel = Mage::getSingleton('catalog/product');
   $productObj = $productModel->load($product_id);
    if (!$quoteObj) {
       // echo 'if'; die;
        $quoteObj = new Mage_Sales_Model_Quote();
    }
    $store_id = Mage::app()->getStore()->getId();
    $storeObj = $quoteObj->getStore()->load($store_id);
    $quoteObj->setStore($storeObj);

    $quoteItem = Mage::getModel('sales/quote_item')->setProduct($productObj);
    $quoteItem->setQuote($quoteObj);
    $quoteItem->setQty($qty);
    $quoteItem->setStoreId($store_id);
    $quoteObj->addItem($quoteItem);
    $quoteObj->setStoreId($store_id);
    $quoteObj->collectTotals();
    $quoteObj->setCustomerId(null);
    $quoteObj->setDeviceId($deviceId);
    $quoteObj->save();
    }
    else{
        $qtys+=$qty;
    $items->setQty($qtys);
    $ks=$items->getQty();
    $items->save();

    }

}

}
}
else{
$productModel = Mage::getSingleton('catalog/product');
   $productObj = $productModel->load($product_id);
    if (!$quoteObj) {
       // echo 'if'; die;
        $quoteObj = new Mage_Sales_Model_Quote();
    }
    $store_id = Mage::app()->getStore()->getId();
    $storeObj = $quoteObj->getStore()->load($store_id);
    $quoteObj->setStore($storeObj);

    $quoteItem = Mage::getModel('sales/quote_item')->setProduct($productObj);
    $quoteItem->setQuote($quoteObj);
    $quoteItem->setQty($qty);
    $quoteItem->setStoreId($store_id);
    $quoteObj->addItem($quoteItem);
    $quoteObj->setStoreId($store_id);
    $quoteObj->collectTotals();
    $quoteObj->setCustomerId(null);
    $quoteObj->setDeviceId($deviceId);
    $quoteObj->save();
}

     echo json_encode(array('success' => $ds,'quoteObj' => $ks,'quoteObj' => $dss)); die;

}


texts: Magento 1.9x - Include Dataflow Profile Functionality for Import operation into my custom module

texts:
I have created custom module for import operation by uploading csv, xls and ods files. It is working good, but now i need to include Dataflow Profile Functionality into my module.
That means I have a button in the page when i click that button is should do the operation like as Run Profile in Popup button (kindly look at the below pictures)

no need to override the GuiController or ProfileController
i just need functions of them in my module..
kindly share your suggestions.


texts:
I have CMS static block and I must show in this block individual product name.

When I am going to product page I want show name this product in a static block.

How to do this?


texts: Google Content API for Shopping not adding all products

texts:
So, I've recently switched a Magento store from using XML feeds to using the Google Content API. I've installed the official Magento extension which is being used to feed the API.

Almost all products have been added succesfully. I'm left with 35 products which are not being added to Google Shopping, without any reason whatsoever. The products are all in stock, are visible in catalog and search and are active. They have also been added to the proper store and website and are assigned to a category. The module also throws no errors.

What would be the proper way to fix this?


texts: Magento 2.3 : Getting qty from all assigned sources (Multi warehouse inventory) programmatically

texts: How to get qty from all assigned sources (Multi warehouse inventory) programmatically i.e sources and corresponding quantities.


texts: Why does magento2 display errors mostly related to core instead of the custom module files where core is extended?

texts:
When we extend a core module/controller, say loginPost, and if some error occurs, why does Magento2 show most core level errors,and some times a single line of our custom extended file?

Can somebody here answer in detail.


texts:
this is the error I get with my Magento 2 module, in my logs:

  Warning: Illegal string offset 'itemID' in
  /a/www/vhosts/domain.com/mage2.domain.com/deploy003/app/code/Maurisource/Lightspeed/Helper/Catalog/Product/Configurable.php
  on line 68

This is line:68 it's referring to:

foreach ($rawData['Items']['Item'] as $item) {
    $simpleProductLightspeedId[] = $item['itemID'];
}

This is the output of debug.log

$this->_logger->debug(json_encode($rawData['Items']['Item']));

  [2017-11-22 21:43:36] main.DEBUG:
  [{"itemID":"14","systemSku":"210000000020","defaultCost":"0","avgCost":"0","discountable":"true","tax":"true","archived":"false","itemType":"default","serialized":"false","description":"manesh-matrix-color
  a b
  c","modelYear":"0","upc":"","ean":"","customSku":"","manufacturerSku":"","createTime":"2016-05-02T18:33:46+00:00","timeStamp":"2016-06-02T19:22:26+00:00","publishToEcom":"false","categoryID":"2","taxClassID":"1","departmentID":"0","itemMatrixID":"3","itemAttributesID":"3","manufacturerID":"5","noteID":"16","seasonID":"0","defaultVendorID":"0","itemECommerceID":"0","Prices":{"ItemPrice":[{"amount":"788","useTypeID":"1","useType":"Default"},{"amount":"788","useTypeID":"2","useType":"MSRP"},{"amount":"788","useTypeID":"3","useType":"Online"}]}},

I think this error suggests that $rawData['Items']['Item'] is not an array. But I'm not sure what's wrong here, any hints?


texts: Move in stock/out of stock inline with title

texts:
in my theme, I need to display either "in stock" or "out of stock" in detail page. it's shown by default. I needed to display it right after the title. in one line.
I moved in stock inside title block. but the problem is, There is a <h1> tag inside the title.phtml file and I need in stock to be <span> inside that `'.
I can't move further in XML. Can't edit title.phtml to put span because when I do, it will affect for the every title instances inside my project.

How can I put a span inside h1 tag and instruct it to only display when on a product view?


texts: What could cause this (config) cache issue after upgrading from 2.1.14 to 2.1.15?

texts:
after upgrading a shop from 2.1.14 to 2.1.15 I'm getting the following exception when visiting any page via the browser:

1 exception(s):
Exception #0 (Exception): Notice: Undefined index:  in /src/vendor/magento/module-developer/Model/View/Page/Config/RendererFactory.php on line 64

Exception #0 (Exception): Notice: Undefined index:  in /src/vendor/magento/module-developer/Model/View/Page/Config/RendererFactory.php on line 64
#0 /src/vendor/magento/module-developer/Model/View/Page/Config/RendererFactory.php(64): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined index...', '/src/vendor/mag...', 64, Array)
#1 /src/vendor/magento/framework/View/Result/Page.php(149): Magento\Developer\Model\View\Page\Config\RendererFactory->create(Array)
#2 /src/vendor/magento/framework/View/Result/Page.php(139): Magento\Framework\View\Result\Page->initPageConfigReader()

I suspect there is something wrong with writing the cache. The homepage for example renders fine the first time, and on a refresh this exception is shown. When I then clear the cache and refresh the page shows again.
Also, everything works fine when disabling the Magento cache completely.

It happens in both developer and production modes, and also in 2.1.16.

What could possibly cause this?


texts: Magento 2 : Event Observer For Payment Method Selection

texts:
I am working on a custom extension where I need to call an observer when any payment method is select from the available payment method list on the frontend checkout page.

Can anyone tell me which event observer should I used for this?
I need to call a custom function and add fee to the cart subtotal.


texts: Magento 2 : Adding multiple configurable product variations in cart

texts:
I'm trying to add multiple variations of a configurable product to the cart at once, and I've put the code together, but currently it's adding the right qty of products, but only using the first variation.

In other words, if I try to add 2 Green T-Shirts and 4 White T-Shirts, It's adding 6 Green T-Shirts into cart.

This is the code I've got inside add controller:

public function execute()
    {
        $paramsData = $this->getRequest()->getParams();
        try {
            $msg = array();
            $errorMsg = array();
            foreach($paramsData['qty'] as $pId=>$param){

                if (isset($param)) {
                    $filter = new \Zend_Filter_LocalizedToNormalized(
                        ['locale' => $this->_objectManager->get('Magento\Framework\Locale\ResolverInterface')->getLocale()]
                    );
                    $params['qty'] = $filter->filter($param);
                }

                $params['product'] = $paramsData['product'][$pId];
                $product = $this->initProduct($params['product']);
                $params['super_attribute'] = $paramsData['super'][$pId];
                /**
                 * Check product availability
                 */
                if (!$product) {
                    return $this->goBack();
                }

                $this->cart->addProduct($product, $params);
                $msg[] = $product->getName();
            }

            $this->cart->save();

        }
        $resultRedirect->setPath('checkout/cart');
        return $resultRedirect;
    }

And from that print_r, it's confirming that the options are correct:

 Array ( [super_attribute] => Array ( [90] => 5 ) [qty] => 2 )

 Array ( [super_attribute] => Array ( [90] => 7 ) [qty] => 4 )

But in the cart I'm seeing 6 of the first super_attribute(6 green T-Shirts instead of 2 green and 4 white t-shirt).

Is there something I need to do to 'reset' the cart after adding each item or something?

Thanks.


texts: Magento 1.9 custom soap api module cannot get product final price from collection

texts:
I created a custom module that extends the core API with a new method that allows me to get a product collection based on specific filters. The method works so far, but I am having issues with the final price. This is what I have now:

$product_collection = Mage::getModel("catalog/product")->getCollection()
        ->addAttributeToSelect('entity_id')
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('sku')
        ->addAttributeToSelect('price')
        ->addAttributeToSelect('final_price')
        ->addAttributeToSelect('status')
        ->addAttributeToSelect('manufacturer')
        ->addAttributeToSelect('season')
        ->addAttributeToSelect('product_category')
        ->addAttributeToSelect('activity')
        ->addAttributeToSelect('gender')
        ->addAttributeToSelect('material')
        ->addAttributeToSelect('color')
        ->setOrder('entity', 'DESC')
        ->setPageSize(10);

The above works just fine, but when I try adding ->addFinalPrice(), the collection comes up empty. I have used ->addFinalPrice() before in another module, and it works just fine, so I am at a loss as to what is different this time...

Anyone care to elaborate?


texts:
I am using Magento 2 on Host Amazon LightSail:

https://aws.amazon.com/lightsail/

But email is not working (sent email when register, forget password, place order, ...)

So, I installed Extension SMTP extension and it is working fine and Email is working:

https://github.com/mageplaza/magento-2-smtp

(Also I tried many extensions for smtp and all working fine)

But I have a problem, that the email is sent with the header which is set  as a username config authentication in extension backend. It is supposed to be the real email set in magento backend for General Contact, Sales Email, Customer Support, ...

Is there any answer to make email working without any extension? OR
If I continue with the extension, how can I make the email sent with the correct header which set?


texts: Changing the Horizontal pixels of website

texts:
This is my website http://www.dirtrades.com and I’m currently using this theme (http://demo.pagayo.com/pagayotheme001/). Although this theme is great and better, comes for free I still have the complaint for with its Horizontal size. It’s too large to fit in screen. I don’t think that Customers actually like scrolling the page searching for things they want. I want the website to fit in the page. Being an amateur in PHP, I really don’t have any idea how can do it. I know if the length is changed then I’ll have to change the size of images too, but isn’t this possible that the images get resized automatically? Anyways, if that’s too hard to incorporate then anyone can please help me in at least making my website page fit in the screen horizontally? I’m good with vertical size, that is scrollable and the customers wouldn’t mind in scrolling through width. So, in short I want help in following:

  1)    Making the website fit in customer’s screen as per their browsers setting & resolution, automatically.

IF automatic accommodation of page is not possible, then

  2)     Help with the code to at least make the website fit in full, horizontally so that customers do not have to scroll for horizontal view.
  If you’re gonna suggest me a code change then it’s my folded hand request to please provide the code as well and the directory path where I should make the change. I’m a child in the world of coding and Magento so I don’t know anything. All I know is, I have to complete my website anyhow!

Please help me out and I’ll buy you a beer :)


texts:
My main goal is to have a plugin which inserts/updates my products.

All my products are currently in a business management software database which I have SQL access for. What is the best way to go about this?

I guess what I'm looking for is how to add/update products inside of a plugin.

This it the current plan:

Have the plugin code run on a CRON job
Connect to the BMS and select the records (which will include the fields that the Magento Import system requires)
Go line by line and either inserts or updates the record (guessing by checking if the SKU already exists)

Thanks


texts: Magento gift wrap amount & shipping country variables

texts:
does anyone know how to show the gift wrap amount & shipping country in order confirmation

currently found this code for subtotal :

<?php echo Mage::helper("core")->currency($order_details->subtotal) ?>

also to show the shipping country id,

<?php $shipping_address_data = $order_details->getShippingAddress(); ?>
<?php echo $shipping_address_data['country_id']; ?>

the rest variable, is hard to find.


texts: Luma theme home page content not showing

texts:
I have downloaded Magento CE 2.1.8 and installed it on a local system, now when I access the home url Luma theme shows a page like this:

Instead if something like this:


texts: Magento 2 | Override Magento_Downloadable

texts:
I want to override this file in my module:

  /var/www/magento2-dev/vendor/magento/module-downloadable/Helper/Download.php

to

  /var/www/magento2-dev/app/code/My/Module/Helper/Download.php

How can I do that?

Thanks!


texts: local.xml file is not pulling in my phtml layout

texts:
I'm trying to create my first Magento template from scratch. I created my local.xml file under app/design/frontend/default/my_theme/layout/

In it, I've referenced my preferred layout:

<new_layout translate="label">
    <label>Medtech</label>
    <reference name="root">
        <action method="setTemplate"><template>page/home.phtml</template></action>
        <!-- Mark root page block that template is applied -->
        <action method="setIsHandle"><applied>1</applied></action>
    </reference>
</new_layout>

My home.phtml template is located under app/design/frontend/default/my_theme/template/page/

But, it's not loading this layout file when I navigate to my home page. (It appears to be loading one of the default template layouts).

What am I doing wrong?


texts: What Runs before the Magento Profiler Starts?

texts:
I have found that the TTFB is really high, like 1 - 1.2 seconds.

But the profiler says 200ms.

What is causing this huge descrpency.

I am using a local php server:

php -S magento:4444 router.php


texts: Magento2 cart not finding afterRender function

texts:
In my magento2 minicart i have afterRender: loadJsAfterKoRender

-

                           <input data-bind="afterRender: loadJsAfterKoRender,attr: {
                           id: 'cart-item-'+item_id+'-qty',
                           'data-cart-item': item_id,
                           'data-item-qty': qty,
                           'data-cart-item-id': product_sku
                           }, value: qty"
                           type="number"
                           size="4"
                           class="item-qty cart-item-qty qty-box-additions">

+

and above the same page in the script tag

But when the minicart loads i get the error

  knockout.js:3381 Uncaught ReferenceError: Unable to process binding
  "afterRender: function(){return loadJsAfterKoRender }" Message:
  loadJsAfterKoRender is not defined


texts: "/usr/bin/sed: illegal option -- 2" error when applying a .sh format patch on Mac OS X 10.9

texts:
I tried to execute an offical SUPEE-6788 patch file. However, I got sed-related errors as following:

$ sh /path/to/PATCH_SUPEE-6788_CE_1.9.2.0_v1-2015-10-26-11-37-50.sh
sed: /path/to/PATCH_SUPEE-6788_CE_1.9.2.0_v1-2015-10-26-11-37-50.sh: No such file or directory
Checking if patch can be applied/reverted successfully...
sed: /path/to/PATCH_SUPEE-6788_CE_1.9.2.0_v1-2015-10-26-11-37-50.sh: No such file or directory
sed: /path/to/PATCH_SUPEE-6788_CE_1.9.2.0_v1-2015-10-26-11-37-50.sh: No such file or directory
Patch was applied/reverted successfully.
/usr/bin/sed: illegal option -- 2
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]

My environment is Mac OS X 10.9.5 (Darwin 13.4.0)

Any ideas?


texts:
I want to add a validation when the we click on the button 'invoice'.

In the code /app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php,
we have the function

public function getInvoiceUrl()
    {
        return $this->getUrl('*/sales_order_invoice/start');
    }

where can I see the code of */sales_order_invoice/start ?

Thank you


texts: Magento 2.2.5 - First Name is not visible in Shipping and Billing Address

texts:
My Magento 2.2.5 Store is not allowing a registered customer to place an order if the customer uses the saved/default billing/Shipping address instead of a different address. The store displays an error saying

"Please check the shipping address information. First name is a required field".

When, the customer use a new address. It allows the user to place an order without any error as follows:

It can be seen that First name is present in this case...

I have checked the database and It has the first name saved. But on front end it doesn't display the first name in billing and shipping address as follows:

I have also tried editing the default billing and shipping address and when I press the edit button the first name field is empty. I tried to fill the first name field and saved the address, but still it is not displaying the first name.

The next time I press edit button the first name field stays empty as follows:

Any idea what could be reason behind this error. And what can be done to resolve it?


texts: What magento version is it best to develop a module for?

texts:
I'd like to ask what magento version is it better to develop a module for so that it would be compatible with most versions.

Any professional opinion?

Thanks!


texts: Grid incorrect Date Issue in admin custom module

texts:
custom admin grid is showing incorrect date & time .in my database its showing correct also in view detail page its showing correct but in my grid its showing incorrect

Database Date is : 2015-04-10 21:10:54

Grid date is showing incorrect :  Apr 10, 2015 4:20:45 PM

I am using the below Code in my grid :

  $this->addColumn('created_date', array(
            'header'    => Mage::helper('mymodule')->__('Date'),
            'align'     => 'left',
            'type'      => 'datetime',
            'index'     => 'created_date',
            'width'     => '150px',
        ));

at the time of save the date i am using the below Code :
   'created_date'=>date('Y-m-d H:i:s'),

its showing in database correct but in grid its showing incorrect

Any Help much be appreciated


texts: Product Description Not Appearing. Lower bar not working

texts:
The lower bar on the frontend that contains description, additional information, and Reviews tab is not click-able.

How do I fix this?  As I do not know where to start.

This is what my app.js shows under this heading.

// ==============================================
    // UI Pattern - Toggle Content (tabs and accordions in one setup)
    // ==============================================

$j('.toggle-content').each(function () {
    var wrapper = jQuery(this);

    var hasTabs = wrapper.hasClass('tabs');
    var hasAccordion = wrapper.hasClass('accordion');
    var startOpen = wrapper.hasClass('open');

    var dl = wrapper.children('dl:first');
    var dts = dl.children('dt');
    var panes = dl.children('dd');
    var groups = new Array(dts, panes);

    //Create a ul for tabs if necessary.
    if (hasTabs) {
        var ul = jQuery('

');
        dts.each(function () {
            var dt = jQuery(this);
            var li = jQuery('

');
            li.html(dt.html());
            ul.append(li);
        });
        ul.insertBefore(dl);
        var lis = ul.children();
        groups.push(lis);
    }

    //Add "last" classes.
    var i;
    for (i = 0; i < groups.length; i++) {
        groups[i].filter(':last').addClass('last');
    }

    function toggleClasses(clickedItem, group) {
        var index = group.index(clickedItem);
        var i;
        for (i = 0; i < groups.length; i++) {
            groups[i].removeClass('current');
            groups[i].eq(index).addClass('current');
        }
    }

    //Toggle on tab (dt) click.
    dts.on('click', function (e) {
        //They clicked the current dt to close it. Restore the wrapper to unclicked state.
        if (jQuery(this).hasClass('current') && wrapper.hasClass('accordion-open')) {
            wrapper.removeClass('accordion-open');
        } else {
            //They're clicking something new. Reflect the explicit user interaction.
            wrapper.addClass('accordion-open');
        }
        toggleClasses(jQuery(this), dts);
    });

    //Toggle on tab (li) click.
    if (hasTabs) {
        lis.on('click', function (e) {
            toggleClasses(jQuery(this), lis);
        });
        //Open the first tab.
        lis.eq(0).trigger('click');
    }

    //Open the first accordion if desired.
    if (startOpen) {
        dts.eq(0).trigger('click');
    }

});


texts: Magento 1.9.4 - Plugin recommedation for changing category prices

texts:
Good morning,

i need a module to change all product prices for a specific category.

Example: I want to increase / decrease the product prices for all articles of the category "towel" by 2% or 3,5€.

I didnt find a module that helps me doing it (Magento v. 1.9.4).

I was also looking for catalog price rules. Maybe someone can tell me how to modifiy the discount field, so i can enter negative discount values to add a price. In that case the discount should not shown in the shop, because it doesnt make sense to show a discount that value is higher than the original...

I hope someone can help me.

kind regards
Chris


texts: Why the error when creating a new product "Asymmetric transaction rollback."?

texts:
When creating a new product and trying to save it, I get the following error message:

  Asymmetric transaction rollback error

Has anyone else encountered this? Please share the fix :)


texts:
Trying to create a module that redirects the customer to the account creation page when they add to cart if they are not logged in, I have the following code in app/code/Mason/CheckoutRedirect/Plugin/Checkout/Controller/Cart/Add.php:

namespace Mason\CheckoutRedirect\Plugin\Checkout\Controller\Cart;

class Add
{
    /**
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $objectManager;

    /**
     * @var \Magento\Framework\Controller\Result\RedirectFactory
     */
    protected $resultRedirectFactory;

    /**
     * @var \Magento\Framework\UrlInterface
     */
    protected $url;

    /**
     * Data constructor.
     *
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     * @param \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory
     * @param \Magento\Framework\UrlInterface $url
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory,
        \Magento\Framework\UrlInterface $url
    ) {
        $this->objectManager = $objectManager;
        $this->resultRedirectFactory = $resultRedirectFactory;
        $this->url = $url;
    }

    public function aroundExecute(
        \Magento\Checkout\Controller\Cart\Add $subject,
        \Closure $proceed
    ) {
        $contactUrl = $this->url->getUrl('customer/account/create');
        $result = [];
        $result['backUrl'] = $contactUrl;

        $subject->getResponse()->representJson(
            $this->objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result)
        );
        return;
    }
}

All this is doing is returning a JSON object:

{"backUrl":"https://domain.com/customer/account/create/"}

But it isn't redirecting


texts: Magento2: How to show product URL on Homepage

texts:
I have to show list of product on same category on homepage

I have achieved the same using CatalogWidget but got issue with URL,
It shows URL like example.net/product but I want to show URL like example.net/category/product  on homepage

how can I achieve the same


texts: popup hints on product page required field

texts:
This is my product page

If customer no select storage or color and click "add to cart" nothing happens so I want make popup with hints but I dont know wherein the file and how it should look condition.


texts: Magento 2 save guest order to specific customer

texts:
I am trying to assign a guest order to a specific customer programmatically.

I have loaded the collection of orders placed by the guest users using following code:

public function __construct(
    \Magento\Sales\Model\ResourceModel\Order\CollectionFactory    $orderCollectionFactory,
) {
    $this->orderCollectionFactory = $orderCollectionFactory;
}

public function getGuestOrderCollection()
{
    $orderCollecion = $this->orderCollectionFactory
        ->create()
        ->addFieldToSelect('*');

    $orderCollecion->addAttributeToFilter('customer_is_guest', ['eq'=>1]);
    foreach($orderCollecion as $orderData){
        if($orderData->getCustomerId()){
            $order->setCustomerId($orderData->getCustomerId());
            $order->setCustomerIsGuest(0);
            $this->orderRepository->save($orderData);
            $message = "DONE";
        } else {
            $message = "Fail";
        }
    }
    return $message;
}

It doesn't work. It's not saving the order to that customer.

Not getting any error though.

What am I doing wrong? Any help would be greatly appreciated.


texts: Magento 2.1: How can i add email to "New Invoice" template

texts:
I'm using Magento 2.1.2 for my ecommerce and trying to figure out how to add customer email to "New Invoice for Guest" and "New Order for Guest" email template.

Is there a way to add customer email address to those email templates? If not, is it possible to add it to "Address Templates" (System > Configuration > Customers > Customer Configuration > Address Templates)?

I thought that it might be something like this:

{{var order.getCustomerEmail()}}

or

{{var email}}

But can't get that to work. Any ideas are welcome!


texts: Magento 2 : How to redirect from a observer without exit or die (as it's not allowed by magento standards)

texts: I know of a couple of ways of redirecting to a given URL in observer but all of them uses exit or die and they would not work without it. So, if someone knows of a way of doing it without using exit or die then please let me know.


texts: Magento 2: Observer constructor not working

texts:
I am creating an observer for an event in Magento 2 and followed all the steps in the documents I should follow. The observer is called after I registered it in the events.xml file. However, it doesn't work when I set a dependency in the constructor.

So, strangely enough, this code doesn't work:

<?php
namespace MyName\MyModule\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;

class MyObserver implements ObserverInterface
{
    protected $_storeManager;

    public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager
    ){
        $this->_storeManager = $storeManager;
    }

    public function execute(Observer $observer)
    {
        //Observer execution code...
        echo 'This is a test';
    }
}
?>

And when I leave the constructor empty, everything works fine:

public function __construct(){

}

This is the case for every dependency I try to load. Can anyone figure out what I am doing wrong?

Thanks!


texts: Magento 2 : Overriding Default Contact Controller POST Action

texts:
I'm trying to rewrite default post action of contact controller in my custom module.
di.xml is

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Contact\Controller\Index\Post" type="Company\Helloworld\Controller\Contact\Index" />
</config>

And Controller file is

<?php
namespace Company\Helloworld\Controller\Contact;
class Index extends \Magento\Contact\Controller\Index\Post {

    public function execute( $coreRoute = null )
    {
        $post = $this->getRequest()->getPostValue();
        if (!$post) {
            $this->_redirect('*/*/');
            return;
        }

        $this->inlineTranslation->suspend();
        try {
            $postObject = new \Magento\Framework\DataObject();
            $postObject->setData($post);

            $error = false;

            if (!\Zend_Validate::is(trim($post['name']), 'NotEmpty')) {
                $error = true;
            }
            if (!\Zend_Validate::is(trim($post['comment']), 'NotEmpty')) {
                $error = true;
            }
            if (!\Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
                $error = true;
            }
            if (\Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
                $error = true;
            }
            if ($error) {
                throw new \Exception();
            }

            $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
            $transport = $this->_transportBuilder
                ->setTemplateIdentifier($this->scopeConfig->getValue(self::XML_PATH_EMAIL_TEMPLATE, $storeScope))
                ->setTemplateOptions(
                    [
                        'area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE,
                        'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
                    ]
                )
                ->setTemplateVars(['data' => $postObject])
                ->setFrom($this->scopeConfig->getValue(self::XML_PATH_EMAIL_SENDER, $storeScope))
                ->addTo($this->scopeConfig->getValue(self::XML_PATH_EMAIL_RECIPIENT, $storeScope))
                ->setReplyTo($post['email'])
                ->getTransport();

            $transport->sendMessage();
            $this->inlineTranslation->resume();
            $this->messageManager->addSuccess(
                __('Thanks for contacting us with your comments and questions. We\'ll respond to you very soon.')
            );
            $this->getDataPersistor()->clear('contact_us');
            $this->_redirect('contact/index');
            return;
        } catch (\Exception $e) {
            $this->inlineTranslation->resume();
            $this->messageManager->addError(
                __('We can\'t process your request right now. Sorry, that\'s all we know.')
            );
            $this->getDataPersistor()->set('contact_us', $post);
            $this->_redirect('contact/index');
            return;
        }

    }

}

But, after submitting contact form, I'm getting following error

Fatal error: Call to private method Magento\Contact\Controller\Index\Post::getDataPersistor() from context 'Company\Helloworld\Controller\Contact\Index' in .../app/code/Company/Helloworld/Controller/Contact/Index.php

It's because of calling private function in default controller. I tried to copy same function here. But because of $this object calls in parent class, I'm getting error continuously. How to avoid this error and rewrite this controller action?


texts: Magento 2 cron_schedule table increasing and CPU 100%

texts:
I updated to 2.2.1 from 2.1.10 and that looked good. But my CPU is increasing a lot and it went to over 100% in a few days.

The problem is the cron jobs because also the table cron_schedule was very full with 249.000 rows.

Any idea what causes the problem in the cronjobs?


texts:
Why does the translation for "Total-Weight", "Gesamtgewicht" does not work,

but the translation for "Total Weight", "Gesamtgewicht" not?

"Single Weight", "Einzelgewicht" -- works

"Total Weight", "Gesamtgewicht" -- does not work

What im missing here?


texts:
I found this code in a xml file:

<action method="setAvailableProducts">
      <value helper="mmartinovic_productlist/getAvailableOrders"></value>
</action>

Is there a similar way to filter products that are out of stock (by default I have to show all the products, regarding if in stocks or not)


texts: How to get lifetime best seller products

texts:
I am creating an API for getting best seller products.
There are a lot answer on community which answering for get best seller on monthly/yearly basis.
I want to get lifetime bestselling product just like Admin dashboard bestseller.

/vendor/magento/module-backend/Block/Dashboard/Tab/Products/Ordered.php

/vendor/magento/module-backend/Block/Dashboard/Grids.php

I looked on above file and they are responsible for Showing bestseller on Admin dashboard But I could not replicate for APIs
Thanks in advance


texts: Magento 2.3: How to print order without invoice

texts:
It looks like in the admin, you're only able to print the order via the invoice or shipment -- but orders that are pending that were paid via PO or COD methods, there's no option to print the order.

Is it possible to print order directly from the admin order view regardless of invoice / shipping status?

I don't have any code to share yet as I'm not quite sure where to start and haven't really found much info anywhere else.


texts: Where is my homepage code and the reference to a static block?

texts:
My cms - home page has only this...

I notice others often have something more akin to a normal looking page structure. I have a theme installed and I've found both of the files being pointed to here.

The reason I would like to know is that I have some images which were created in a static block being displayed in the left hand column of the home page. I can find no reference to the static block in either of the two files. So how does magento know to display the static block? I would like to know as I want to add the same kind of behavior to other pages.

Would appreciate any assistance

When I click on design the options are empty...

I don't see the references you refer to. Appreciate your help.

UPDATE

Here is the screenshot of the homepage, thanks


texts: Simple search is not working In Magento 2.1.7

texts:
I am new to Magento 2 and facing a problem in simple search. I searched product name but result is not displaying.

The layered navigation return correct answer but product is not showing.

How can I fix this?


texts: Product page color filtering - Magento 2.1.7

texts:
I created a color attribute for my products and gave the filter option in the product category.

I only see 24 colors but I've put in a lot more.
How can I increase the visibility from 24 to all the colors that I have?


texts:
I have a multilingual site and for display language-specific block i have to create a different static block for each language-specific store.

Is there any methods or way available to translate static block content.

I am displaying a static block from cms pages.

I have check this thread how to create multilingual static block


texts: create custom variable for custom module in magento 2

texts: Is it impossible to create a custom variable, such as {{var customer.getName()}} in a custom module and use it?


texts: Disable default magento free shipping method at frontend ONLY

texts:
Store -> Settings -> Configuration -> Sales -> Shipping Methods -> Free Shipping

How can I disable this default feature of Magento in frontend only?


texts: External js for magento 2 backend not loaded

texts:
I create the external js for magento 2 backend like this:

Namespace/Module/view/adminhtml/requirejs-config.js:

 var config = {
    map: {
        '*': {
            regionsForm: 'Namespace_Module/js/regions-form'
        }
    }
};

in Namespace/Module/view/adminhtml/web/js/regions-form.js

    define([
        'jquery',
        'underscore',
        'mage/url',
        'jquery/ui'
        ], function ($, _,urlBuilder) {
        'use strict';
        $(function() {
           console.log('a');
        });
    });

i already delete pub/static and ran setup:upgrade & static:content, but when i inspect element in my browser i cant find my js file, but in pub/static my file is already there.

Edit:
I ran deploy command php bin/magento setup:static-content:deploy


texts: Magento 2 Error mini cart not show the products Error return $parent.getRegion($parent.getItemRenderer(item.product_type))

texts:
I have a custom template and i copied the all files

  module-checkout/view/frontend

and i paged to my custom template

  /Magento_Checkout

but i have an error in the console and the minicart in the front not list the products

Error Uncaught TypeError: Unable to process binding "foreach: function (){return $parent.getRegion($parent.getItemRenderer(item.product_type)) }"
Message: Cannot read property 'simple' of undefined

My version magento is ver. 2.1.3

Thanks


texts:
I am using Magento version 2.1.3 for my website.

We are getting the correct 404 page while accessing the non-existing url.
But I need to redirect the url to "/404" as well for the magento 404 page.

For Example:
I have accessed my website with "/abc" and getting 404 page but the url remains same as
www.domain.com/abc

I need to redirect the url to "/404" instead of getting the same url("/abc") what we have typed for every 404 Pages.

www.domain.com/abc should redirect to www.domain.com/404 if it is non existing url.

Please can any one suggest a best solution for this...

Please advise,
Sandra


texts: Where is sales_model_service_quote_submit_before dispatched?

texts: Where in the source does the event sales_model_service_quote_submit_before dispatch in Magento 2?


texts:
When I change the position of products in a category, then the whole webshop will have database problems. When I debugged the problem, I saw that the table core_url_rewrite was the problem. This table has about 843.000 rows. The table has lots of product URL`s, like:

samsung-led-tv-playstation-2704 -> samsung-led-tv-playstation-2707
samsung-led-tv-xbox-one-4506 -> samsung-led-tv-xbox-one-4509
lg-led-tv-xbox-one-2269 -> lg-led-tv-xbox-one-2270
hp-desktop-pc-met-20-inch-scherm-3448 -> hp-desktop-pc-met-23-inch-scherm-7464

As you can see, the URL`s are the same but the ending number is different.

So, what is this number and what causes that those rows were added?


texts: I would like to get the getLoginUrl() url to put a button to login to my product detail view. Any idea how?


texts: PageBuilder error when saving category magento 2.3.3

texts: On category page when try to save category has error on console ([ERROR] Page Builder was rendering for 5 seconds without releasing locks.) Can't save category changes.  I try these solutions but it doesn't work https://github.com/mirasvit/module-blog/issues/162, https://github.com/magento/magento2/issues/25620. I have porto theme and module Smartwave_Maegamenu. Please help =)


texts: I want to configurable product add to cart programmatically in magento 2 to customer cart


texts: Configurable swatch not working properly

texts:
In magento 1.9.2.2, I added configurable swatches for color attribute.

The swatches are displayed and the color of the product changes, when the swatches are accessed. But the swatches are not working properly, when it is selected after selecting any thumbnail image i.e. when I select a thumbnail image and then select a color in the swatch, the thumbnail image is displayed instead of the selected color product.

The swatches are working perfectly when no thumbnail image selected in between.

What should be done to fix this issue?


texts: Need to get customer order list from Rest API

texts:
First I tried this endpoint /rest/V1/orders to get list of all orders history for a customer but got this error:

{
"message": "The consumer isn't authorized to access %resources.",
"parameters": {
    "resources": "Magento_Sales::sales"
}

Then I have used custom endpoint as mentioned in this link How can we get customer orders history with rest API

like that:

    <?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route url="/V1/orders/custom" method="GET">
        <service class="Magento\Sales\Api\OrderRepositoryInterface" method="getList"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>
</routes>

Still I'm getting the same error. I have followed this method for other APIs also and they are working fine. Just this endpoint is not working.


texts: Invalid for key after migration from MagentoEE to CE

texts:
I have an issue with Magento 1.9 as I migrated my website from Magento
EE to Magento CE 1.9, everything is going well but when registration
I got this error message Invalid form key and when I logging with
Facebook plugin I got 404 page not found.

Could you please support me ?


texts:
I am in need of how to make the products not visible within the front end of the system but still be able to place an order against them. I want to make all of them not visible within the customer front end portal.

i.e. I cannot disable the product because it will not let me place an order against them when they have a status of disabled


texts: CSS & navbar edits for a Magento noob - ver. 2.2.6

texts:
I need to make a few simple changes to an existing Magento site, and although I have some wordpress experience, my Magento is currently 0.

It's using a theme called Smartwave Porto, and the changes are fairly elementary:

One of the nav links has 4 sub-categories, and one of these sub categories has an image attached to it, while the others do not. I need to remove this single image.
On single product view there is a countdown delivery timer element. I need to move this further down the page
Again on the single product page there is a bullet list of features. I need to style this list a little.
I need to add a simple style transition when product categories are hovered over

The last 2 are CSS changes, while the first i presume is a nav/category change.  I've looked in catalog>categories in the admin panel, and there is no image attached to the category in question, so it is coming from somewhere else.

Any help hugely appreciated, and if there's a tutorial or other reference that would help, hit me up!


texts: magento 2 admin grid not clickable in ui component

texts:
I am using Magento 2.1.7 version. I have created a custom admin grid module. It is listing out the grid, But I can't click row to edit action.
I followed this link


texts: The mage/cookies module has problems with full page cache

texts:
Magento 2.0.12

I have a widget that depends on mage/cookies, so I have:

define([
    "jquery",
    'jquery/ui',
    "mage/cookies"

], function($){

    // Some stuff

});

Everything works fine until I add an item to cart. When I do it Magento set the private_content_version cookie my widget stops working. It does nothing more, it doesn't pass for any function, it's as if there is nothing in the callback.

The widget returns to work if:

I remove the cookie
I remove "mage/cookies" dependency from my definition function
I disable the cache

None of the three things are fine to me. Any ideas?


texts: How to set CreatedAt date for product review when creating it programmatically?

texts:
I'm trying to Import the product reviews, into my new magento site. For that When I create product review programmatically, I can't set my own date for createdAt field of product review.

When I'm looking into the core file, following function in app/code/core/Mage/Review/Model/Resource/Review.php set the created at date by itself

protected function _beforeSave(Mage_Core_Model_Abstract $object)
    {
        if (!$object->getId()) {
            $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
        }
        if ($object->hasData('stores') && is_array($object->getStores())) {
            $stores = $object->getStores();
            $stores[] = 0;
            $object->setStores($stores);
        } elseif ($object->hasData('stores')) {
            $object->setStores(array($object->getStores(), 0));
        }
        return $this;
    }

I'm running following code to create review programmatically

<?php
ini_set('memory_limit', '128M');
require_once 'app/Mage.php';
Mage::app();
Mage::app()->setCurrentStore(1);
$date = gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 2014));
$review = Mage::getModel('review/review');
$review->setReviewId($review->getId());
$review->setEntityPkValue(1);//product id
$review->setStatusId(1);
$review->setTitle("mytitle");
$review->setDetail("mydetail");
$review->setEntityId(1);
$review->setStoreId(Mage::app()->getStore()->getId());      //storeview
$review->setStatusId(1); //approved
$review->setCustomerId(1);//null is for administrator
$review->setNickname("Menickname");
$review->setCreatedAt($date);
$review->setStores(array(1,3));
$review->save();
$review->aggregate();

How Can I set a date by myself? Is there any way?


texts: Add other information in Dashboard Magento 2

texts:
I have added 3 attribute to customer account and i want to diplay them in account information I just overrided info.phtml but  i just have name and email. Any Idea of how to display this new attributes!!?? and thanks in advance

            <?= $block->escapeHtml(__('Contact Information')) ?>

                <?= $block->escapeHtml($block->getName()) ?>

                <?= $block->escapeHtml($block->getAdresse()) ?>

                <?= $block->escapeHtml($block->getPhone()) ?>

                <?= $block->escapeHtml($block->getCustomer()->getEmail()) ?>

            <a class="action edit" href="<?= $block->escapeUrl($block->getUrl('customer/account/edit')) ?>">
                <?= $block->escapeHtml(__('Edit')) ?>

            <a href="<?= $block->escapeUrl($block->getChangePasswordUrl()) ?>" class="action change-password">
                <?= $block->escapeHtml(__('Change Password')) ?>

This is what i put in InstallData.php

$customerSetup->addAttribute(Customer::ENTITY, 'adresse', [
        'type' => 'varchar',
        'label' => 'Adresse',
        'input' => 'text',
        'required' => false,
        'visible' => true,
        'is_used_in_grid' => true,
        'user_defined' => true,
        'sort_order' => 1001,
        'position' => 1001,
        'system' => 0,
    ]);

    $customerSetup->addAttribute(Customer::ENTITY, 'phone', [
        'type' => 'varchar',
        'label' => 'Phone Number',
        'input' => 'text',
        'required' => false,
        'visible' => true,
        'is_used_in_grid' => true,
        'user_defined' => true,
        'validate_rules' => '{"max_text_length":255,"min_text_length":1}',
        'sort_order' => 1002,
        'position' => 1002,
        'system' => 0,
    ]);


texts:
Magento 2.3

Is there a way you can change a products attributes depending on the choice of the first attribute.

For example... I have 3 types of curtain rails Straight, U Shaped and L Shaped each of these types come in different sizes ie U Shaped -> 500mm x 1000mm x 500mm and Straight -> 2000mm.

Or is the solution making 3 separate products U Shaped, L Shaped and Straight?


texts: Magento2 store logo look distorted on mobile version

texts: I am pretty new in magento. I have uploaded new store logo via backend. It looks fine on desktop/tablet version but look distorted on mobile version. Can we have separate store logo for mobile version, Or can we set different width/height for mobile version?


texts:
In my product review form the form key fetched from core/session is cached and does not pass the validation upon form submission. So,

Mage::getSingleton('cor/session')->getFormKey() and $this->getRequest()->getParam('form_key') return different values.

I don't want to switch off block's caching because it will impact on performance. Is there any way to get actual form key in js? Is it stored somewhere as js variable?

Or is there any other way i can get valid form key without switching the cache off?


texts: Bulk editing products doesn't work correctly

texts:
I'm having an issue on my store. I've got around 2000 items in my product list. I used the magento data migration tools to convert 1.9 to 2.3 successfully. All the products, and the images are showing in the product list.

Currently non of them are showing on the actual store. To have them show I have to do the following to each item in order for it to show on the store:

Set stock to unmanaged (so there's no need to add quantity, we have unlimited stock)
Set waiting for delivery qty to no (for some reason its set to yes on all products)
Set out of stock period to no (again, for some reason it's set to yes on all)
Set manual supply need qty to no (same as above)

If I bulk edit 4 items for example, and hit save, I get the message appear:

Task "Update attributes for 4 selected products": 1 item(s) have been successfully updated.

and

Message is added to queue

If I clear cache and check the store they don't appear.

But, if I then edit each product individually and hit the save button without making any changes the product then appears on the store.

Any idea why I have to go into each product individually just to press save?


texts: How to call one directory tempate file in to other template file in magento

texts:
how to call app\design\frontend\base\default\template\checkout\cart\crosssell.phtml to app\code\local\Cmsmart\AjaxCart\controllers\IndexController\ in popup window

    if(@$product) $json_encode['ajaxcontinue'] = '

getName().'" href="'.@$product->getProductUrl().'">'.@$product->getName().'  '.$this->__('has been added to cart').'.

<button onclick="setLocation(\''.Mage::getBaseUrl().'checkout/\')" class="button btn-continue" title="'.$this->__('Checkout').'" type="button">'.$this->__('Checkout').'</button>

';


texts: Warning: Illegal string offset '__disableTmpl'

texts: When I try to run an import job in Magento 2 I get this weird error and I can't find a solution anywhere else. We are importing with Firebear Improved Import/Export v.3.1.6. When I press "Edit & Run" on an existing import job I'm sending to a different page where I get this error message. What I can see from the error message is that something is wrong in this file "AbstractOptionsField.php".


texts: Blank Page Issue during creating an order from the Backend

texts:
I've tried to disable all the third-party modules by deactivating without any luck. So, I checked from the console and I found the following:

I just want a hint in where I should start.


texts: Magento2: Category selector design doesn't look like default in custom module

texts:
I've created custom module and added category selector in admin form. its work perfect and save values as well. but the problem is its not look like default category selector. I guess css is missing.

see screenshot of category selector of my module.

Here is screenshot of magento default selector.

Does anyone found this type of issue?


texts: Remove freight method and shipping title from checkout cart page

texts:
Is it possible to hide the text for (free) shipping method and shipping title on checkout cart, I dont mind if doesnt show anywhere else on the frontend neither. The freight is free, thats all the customer needs to know.

Sorry, somehow I had typed a misleading title. Sorry. I fixed it now.


texts: Magento 1 : Show custom attribute on product page and make it popup on click

texts:
I am working on magento 1 website and want to show custom attribute ( size chart ) on product page under price and want to make it popup when clicked ( so that size charts can be added in it.

can anyone guide how can i do it.

( i have tried a method i saw on a blog but same didn't worked )


texts: Show block only on checkout #payment step Magento2

texts:
I want to display a block only in the magento2 checkout payment step.

<div class="Checkout-step" data-bind="visible: canVisibleBlock()">
...
</div>

In my javascript file I try to return true on the canVisibleBLock when the user is on the checkout payment step. But this doesn't work. this is my javascript:

    define(
    [
        'jquery',
        'ko',
        'Magento_Checkout/js/model/quote',
        'uiComponent',
    ],
    function ($, ko, quote, Component) {
        'use strict';

        var show_hide_custom_blockConfig = window.checkoutConfig.show_hide_custom_block;

        return Component.extend({
            defaults: {
                template: 'Module_Name/checkout/shipping/additional-block'
            },
            canVisibleBlock: function () {
                if (show_hide_custom_blockConfig) { // returns true when enabled in admin
                    if (quote.isVirtual()) {
                        return true;
                    }
                }

                return false;
            }
        });
    }
);

How can this be fixed?


texts: What is the country code of South Africa- ZAF error

texts: There is error when i try to enter south Africa country code, am googled south Africa country code zaf, but not support in Shipping matrixrate.


texts: Magento 2: How to Extend core js files or class or function?

texts:
I need to extend core js in my module or theme in this case how to do it,

I can achieve it by keeping the complete file in my theme and do the changes, in this case, we will lose updates and if we update Magento then my website will break

How to do it?


texts:
I get the number of products:

Mage::getModel('catalog/product')->getCollection()->count()

But this takes >10 seconds. Maybe because indexer is running or what ever. Can I query a table directly to get this count faster?


texts:
There seems to be very little information out there about creating a Blog on Magento..

I am creating a clothing site for http://www.CrystelleClothing.co.uk and I want to include a blog section for trends and fasions etc...

There is an extension called BLOG (can be found at http://ecommerce.aheadworks.com/free-stuff/blog.html and http://www.magentocommerce.com/magento-connect/blog-community-edition.html) which appears to do this and whilst reviews are good, there is no screen shots etc.

Has anybody used this BLOG extension, or am I best off creating a wordpress blog in the site? or something similar?

Would be useful for a lot of people I think