texts: Array to string convert error $searchResult[]

texts:
Whats wrong in the below code:

$var1 = $this->myhelper->getMyData();
$searchResult = $var1 ;
foreach($searchResult['results'] as $i => $productId) {
    $orderString[] = 'WHEN '.$productId.' THEN '.$i;  //err here
}

I get:

  Notice: Array to string conversion error in $orderString[]

Output for $searchResult:


texts: Magento 1.9 : How to apply more than one price range on product collection

texts:
I want to apply multiple price ranges on final price of product collection. I have tried below code.

$collection->addFinalPrice();
$collection->getSelect()
->where('price_index.final_price <= ' . $maxprice)-
>where('price_index.final_price >= ' . $minprice);

But from above method i can only apply one range to it. Also price range is dynamic. It can be one or more than one.
I found following solution regarding my problem

->addFieldToFilter('final_price',
 array(array('from'=>'0','to'=>'5000'),
 array('from'=>'15000','to'=>'20000')))

But addFieldToFilter is not working on $collection. Any help will be appreciated.


texts: How to solve Unknown hashing algorithm: md5 in Magento 2.3.0?

texts:
I am facing below error since today morning.

 Warning: hash(): Unknown hashing algorithm: md5 in
 vendor\magento\framework\Encryption\Encryptor.php on line 189


texts: Magento 2 How to change currency symbol position left to right

texts:
How to display price currency symbol after the amount on the right side.
from: USD333
to: 333USD


texts:
I'm getting all products with this code:

$collection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('size', array('in'=>$size))
->addAttributeToFilter('room', array('in'=>$room))
->addStoreFilter()
->setOrder('created_at', 'desc')
->setPage($pageNumber, $productPerPage)
->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
$collection->addAttributeToFilter('price', array('gt'=>$priceL));
$collection->addAttributeToFilter('price', array('lt'=>$priceG));

Then I added this code for filter by category:

->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id=entity_id', null, 'left')
->addAttributeToFilter('category_id', array('in' => $catID))

And now, this code work for filter by subcategory but doesn't work for root category. Why? And how do I solve this problem?

EDIT: I'm trying to filter by one category, multi category and root category.


texts: Magento2 Pulling in Customer Data from Third Party instead of Data

texts:
We have a Magento 2 EE 2.1 App:

However, we do not store the Customer entity data in Magento. We query a third party service (over Rest API) to pull the customer information when required.

Each time a user is created we create a dummy user in Magento and store his actual details in the third party service with we keeping an only id of the record present in the third party service.

Now, in magento I need a way where in every time I need Customer info, I would pull that in from the third party service instead of Magento Customer EAV.

I believe (I may be wrong here) Magento 2 design (Service Contracts) is such that the data need not be pulled in always from Database but it is possible to call a REST service to fetch it.

Question is how do I achieve this in code ?


texts:
I am getting the following error. How can I solve this problem?

  500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.


texts: Custom changes stopped showing on Admin Order View

texts:
I have a custom pdf generator for labels and I had it calling a function on the admin order view page.
The files I edited are: /public_html/app/design/adminhtml/default/default/template/sales/order/view/info.phtml

This worked great so far, with the links before the "Edit" on the shipping adress. But somehow, the links have gone away and I can't figure out why as the info.phtml wasn't changed.

Before:

<?php echo Mage::helper('sales')->__('Shipping Address') ?>

<?php echo $this->getAddressEditLink($_order->getShippingAddress())?>

        <fieldset>
            <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
        </fieldset>

After my changes (it has been working until now... ) :

<?php echo Mage::helper('sales')->__('Shipping Address') ?>
            Etiqueta            Registo          Print Label:

<?php echo $this->getAddressEditLink($_order->getShippingAddress())?>

        <fieldset>
            <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
        </fieldset>


texts:
I upgraded Magento 2 to Magento 2.0.3 today, everything went fine until I didn't get my webshop to work anymore with a lot of blank pages. Now I managed to get my pages to see errors again with the permissions set 644, 755 and var + pub + static folders are 777. Now that said I still get an error which is located in the lib/cache route here is the error:

  a:4:{i:0;s:282:"Warning: file_put_contents(var/cache//mage-tags/mage---f56_CONFIG): failed to open stream: Permission denied in lib/internal/Cm/Cache/Backend/File.php on line 661";i:1;s:9007:"
  #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'file_put_conten...', '/home/smartphon...', 661, Array)
  #1 lib/internal/Cm/Cache/Backend/File.php(661): file_put_contents('/home/smartphon...', 'f56_FRONTEND__R...', 10)
  #2 lib/internal/Cm/Cache/Backend/File.php(174): Cm_Cache_Backend_File->_updateIdsTags(Array, Array, 'merge')
  #3 vendor/magento/zendframework1/library/Zend/Cache/Core.php(390): Cm_Cache_Backend_File->save('a:0:{}', 'f56_FRONTEND__R...', Array, NULL)

It seems file.php can't write still while I changed every permission with permission owner and be on. I have no clue on what to do next. I cannot find it anywhere on the internet and never asked a question before so, here we go. Let's see if someone else manage to help me with this error.


texts: Category product->getProductUrl() is really slow

texts:
I just got done diagnosing and (hopefully) resolving an issue with a really slow category listing for a client. After doing some debugging I discovered calling product->getProductUrl() in a foreach loop of the /catalog/product/list.phtml template was causing major slow downs. Has anyone seen this before? The site is fairly large, many thousands of sku's, hundreds of attributes, hundreds of categories.

The solution for now (I'm not sure how sane this is...) was to change the product->getProductUrl() call to "/" . Mage::getResourceSingleton ('catalog/product')->getAttributeRawValue ($_product->getId(), 'url_path', Mage::app()->getStore()); which brought a typical cached category load time down from ~5 seconds to ~2 seconds.

How is this working so much better?


texts: Magento 2.2: (API) set UserContext user type to customer during token creation

texts:
I've been struggling with the following scenario: i have a custom API endpoint to process the guest to customer login. This endpoint basically does the same thing as /integration/customer/token with one exception. During the authentication it merges any products the visitor had as a guest into the customer cart of the account they are logging in to.

Problem is that any which way i try, i keep running into the same error: "Invalid state change requested" when i try to save the updated customer quote.

Some investigation led me to the class \Quote\Model\QuoteRepository\Plugin\AccessChangeQuoteControl in the Magento_Quote module. This class is a plugin that is triggered before the save() method of the QuoteRepository. Turns out that as a guest you are not allowed to save a quote that has customer id. And during the authentication procedure you apparently are still a guest, even after authenticating.

Is there any way to make the backend system aware of the fact that the customer is logged in properly without having to do a second API call that contains the Authorization header with the new token? Somehow i have to make sure $this->userContext->getUserType() in the AccessChangeQuoteControl plugin returns UserContextInterface::USER_TYPE_CUSTOMER in stead of UserContextInterface::USER_TYPE_GUEST but i have no clue on how to make this happen.

Thanks!


texts: In the Magento Difference between Price, Group Price, Special Price, Tier Price, Display Actual Price and Manufacturer's Suggested Retail Price

texts:
In the Magento backend product creation section, In the price tab showing different types of price below.

 1. Price,
 2. Group Price,
 3. Special Price,
 4. Tier Price,
 5. Display Actual Price
 6. Manufacturer's Suggested Retail Price

Please tell me the different between above price and how it's will work, and how  affect the front-end price showing (Price affecting order) ..?

Thank You ...


texts: Adding new fonts to Pdf invoice Magento 2?

texts:
When working with Pdf invoice, I meet a problem about encoding Japanese font. I'm going to add a Japanese font(Gothic) to Pdf invoice, creditmemo, etc. What should I do?

We may rewrite abstract \Magento\Sales\Model\Order\Pdf\AbstractPdf class? Because there are some "hard code" functions to set fonts for Pdf.

 protected function _setFontRegular($object, $size = 7)
 {
        $font = \Zend_Pdf_Font::fontWithPath(
            $this->_rootDirectory->getAbsolutePath('lib/internal/fonts/Gothic.ttf')
        );
        $object->setFont($font, $size);
        return $font;
 }
  ......

 protected function _setFontBold($object, $size = 7)
 {
        $font = \Zend_Pdf_Font::fontWithPath(
            $this->_rootDirectory->getAbsolutePath('lib/internal/fonts/Gothic.ttf')
        );
        $object->setFont($font, $size);
        return $font;
 }

There are some similar issues here and here.


texts: How To Avoid Using the Save method with custom objects in Magento 2

texts:
The save method of AbstractModel is marked to be deprecated, for this reason I try to avoid using it. Normally I do this by using a repository.

That's fine for things like orders which Magento provides the repository for.

For my own custom types I'm not sure what to do. All examples I've seen of creating a custom repository seem to rely on this deprecated method. The only way I can think to write my own save method would be to use an update db query, but that feels like it defeats the purpose of having an ORM.

In short my question is how do you save custom ORM objects in Magento 2 without using a deprecated method or SQL queries?

Apologies if this is a stupid question. I'm worried I'm missing something as Magento will create getters, setters, factories etc for custom types, but as far as I can tell creating a repository for them is a lot of work.


texts:
I have to get the orderId on Checkout page (before success page)

$checkoutSession = $settingsHelper->getCheckoutSession();
$checkoutSession->getQuote()->reserveOrderId();
$reserveOrderId = $checkoutSession->getQuote()->getReservedOrderId();

Is there a better way to do this?


texts: Magento 2: Multistore with the same domain

texts:
I want to have many sites with the same domain, for example, example.com/site1, example.com/site2, and so on...

This is what I've done by far:

1- Change base URL of the site for example.com/site1

2- Create a folder inside root/site1 and add index.php file on site1 folder.

3- Modify the index.php folder with the website code.

4- Create in Pub/site1 folder and again add index.php

I can access the page example.com/site1, but it has no styles or design, also if I click to any of the links it redirects me to example.com and throws 404 error.

Thanks!


texts: Magento 1.9.1 WYSIWYG Editor Logs me out of Backend

texts:
each time I change a product description via WYSIWYG Editor, Submit the Change in the Popup Window and try to Save the article in Magento Backend, it Logs me out of the whole Backend, redirecting to the admin Login Site.

SSL / HTTPS is active and setup correctly. Seems like the Editor itself uses another session ID or cache Option than Magento itself.

Any idea to fix this?

Many thanks!


texts: How to use connection tag in config xml of Magento2

texts:
How do we add this to config.xml of Magento2 from the config xml of Magento1

<productattributesimportexport_write>
     <connection>
        <use>core_write</use>
     </connection>
</productattributesimportexport_write>


texts: Magento 2 - override knockoutjs template located in base folder

texts:
I need to change the value of the maxinput field in the knockoutjs template vendor\magento\module-ui\view\base\web\templates\form\element\input.html so I have to replace the template with my own template loaded from my module app\code\Company\Base\view\base\web\templates\form\element\input.html.
So I created a requirejs-config.js file in my module and tried to override the original knockoutjs file:
app\code\Company\Base\view\base\requirejs-config.js:
var config = {
    map: {
        '*': {
            'Magento_Ui/templates/form/element/input':'Company_Base/templates/form/element/input'
        }
    }
};

...then I cleared the cache, but it is still loading the original template instead of mine.


texts: How to remove none required fields from one-step checkout process (i.e. Fax and Company)

texts: What is the best way to go about removing unnecessary fields during the checkout process? I do not need to collect my customer's company name and fax number, and therefore would like to remove.


texts: Magento 2.X - "Invalid Customer Address Id" comes randomly for the customers on checkout

texts:
I've faced an issue in Magento 2.2.9 says "Invalid Customer address id XXXX" randomly for the registered customers on the website.

[2019-08-09 02:44:33] main.CRITICAL: Invalid customer address id XXXXXX {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): Invalid customer address id 313116 at /vendor/magento/module-quote/Model/QuoteAddressValidator.php:77)"} []

How to fix this issue coming on the Magento 2?

I have checked this further and found that this issue is because of the customer quote which is active and does not have an entry in the quote_address table.

How can we fix this?


texts: Magento Admin redirects to homepage after login

texts:
i configured the magento backend. But now it redirects me to the homepage after successful login. When i type the backend url again, it also directly puts me to the front end.
I did clear all cache, tried different browsers etc.

Can anyone help?


texts: Magento 2 - Token for reset password form not generated

texts:
Sorry if i repeat this question but i prefer for a better explanation.
The issue is when i try to submit reset password form return this error message:
"Something went wrong while saving the new password"
This is my resetforgottpassword.phtml
<form action="<?= $block->escapeUrl($block->getUrl('*/*/resetpasswordpost', ['_query' => ['token' => $block->getResetPasswordLinkToken()]])) ?>"
      method="post"
        <?php if ($block->isAutocompleteDisabled()) : ?> autocomplete="off"<?php endif; ?>
      id="form-validate"
      class="form password reset"
      data-mage-init='{"validation":{}}'>
    <fieldset class="fieldset" data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>">

            <?= $block->escapeHtml(__('New Password')) ?>

                <input type="password" class="input-text" name="password" id="password"
                       data-password-min-length="<?= $block->escapeHtmlAttr($block->getMinimumPasswordLength()) ?>"
                       data-password-min-character-sets="<?= $block->escapeHtmlAttr($block->getRequiredCharacterClassesNumber()) ?>"
                       data-validate="{required:true, 'validate-customer-password':true}"
                       autocomplete="off">

                        <?= $block->escapeHtml(__('Password Strength')) ?>:

                            <?= $block->escapeHtml(__('No Password')) ?>

            <?= $block->escapeHtml(__('Confirm New Password')) ?>

                <input type="password" class="input-text" name="password_confirmation" id="password-confirmation" data-validate="{required:true,equalTo:'#password'}" autocomplete="off">

    </fieldset>

            <button type="submit" class="action submit primary"><?= $block->escapeHtml(__('Set a New Password')) ?></button>

</form>

When i loaded the page customer/account/createPassword/ i saw that in the action form of reset password is not present full link with token code.
This is that i see now:
<form action="https://www.magento2.com/customer/account/resetpasswordpost/" method="post" autocomplete="off" id="form-validate" class="form password reset" novalidate="novalidate">

Why token is not printed?
Thanks


texts: Override Available shipping method template from custom module not working

texts:
I tried to override the core template file which located in

  app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml

like this:

  app/code/local/Test/ShippingCost/etc/config.xml

<frontend>
      <layout>
            <updates>
              <test_shippingcost>
                  <file>test_shippingcost.xml</file>
              </test_shippingcost>
            </updates>
        </layout>
</frontend>

  app/design/frontend/base/default/layout/test_shippingcost.xml

<?xml version="1.0"?>
<layout version="0.1.0">
  <checkout_onepage_index>
    <reference name="checkout.onepage.shipping_method.available">
          <action method="setTemplate">
              <template>test/shippingcost/checkout/onepage/shipping_method/available.phtml</template>
          </action>
    </reference>
  </checkout_onepage_index>
</layout>

  app/design/frontend/base/default/template/test/shippingcost/checkout/onepage/shipping_method/available.phtml

<h1> Success Override </h1>

the problem is, it still shows the old phtml file content instead of the new one


texts: How change currency position from left to right?

texts:
How can I change currency position?

I referred this, But, I have not it app\code\Vendor\Extension\etc\ What should I do?


texts: Magento2: Specified invalid parent id (Magento_Backend::mgs)

texts:
I try instlall MGS Shop by Brand.
Frontend working correct. But in backend I get issue:
1 exception(s):
Exception #0 (OutOfRangeException): Specified invalid parent id (Magento_Backend::mgs)

Exception #0 (OutOfRangeException): Specified invalid parent id (Magento_Backend::mgs)
<pre>#1 Magento\Backend\Model\Menu\Builder\Interceptor->___callParent('getResult', array(&Magento\Backend\Model\Menu#0000000008529c61000000004fa0d711#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#2 Magento\Backend\Model\Menu\Builder\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Backend\Model\Menu#0000000008529c61000000004fa0d711#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#3 Magento\Backend\Model\Menu\Builder\Interceptor->___callPlugins('getResult', array(&Magento\Backend\Model\Menu#0000000008529c61000000004fa0d711#), array(array('mstCoreBuilder'))) called at [generated/code/Magento/Backend/Model/Menu/Builder/Interceptor.php:26]
#4 Magento\Backend\Model\Menu\Builder\Interceptor->getResult(&Magento\Backend\Model\Menu#0000000008529c61000000004fa0d711#) called at [vendor/magento/module-backend/Model/Menu/Config.php:148]
#5 Magento\Backend\Model\Menu\Config->_initMenu() called at [vendor/magento/module-backend/Model/Menu/Config.php:111]
#6 Magento\Backend\Model\Menu\Config->getMenu() called at [vendor/magento/module-backend/Model/Url.php:365]
#7 Magento\Backend\Model\Url->_getMenu() called at [vendor/magento/module-backend/Model/Url.php:325]


texts:
How to move breadcrumbs before toolbar on category pages?
I want to show category page breadcrumbs before sort by dropdown.


texts: change oder totals after change tax item order magento 1.9

texts:
I have add an observer to sales_quote_collect_totals_after to changing tax amount, the tax is changed but order totals and tax totals are wrong.
I tried with :

<checkout_submit_all_after>
            <observers>
                <Module_Sales>
                    <type>singleton</type>
                    <class>Module_Sales_Model_Observer</class>
                    <method>setTaxAmountOrder</method>
                </Module_Sales>
            </observers>
        </checkout_submit_all_after>

Without success finally i try to change the totals by :

 $order = Mage::getModel('sales/order')->load(356);
 $order->setSubtotal(500) ;
 $order->setBaseSubtotal(500) ;
 $order->setGrandTotal(500) ;
 $order->setBaseGrandTotal(500) ;
 $order->setBaseSubtotalInclTax(500) ;

Without success because only setSubtotal has changed.
Can you help me.

this is when i save order

$_items = $order->getAllVisibleItems();
    foreach ($_items as $item) {
        $price = $item->getPrice();
        $basePrice = $item->getBasePrice();
        $_taxHelper = Mage::helper('tax');
        $_store = $item->getProduct()->getStore();
        $_convertedPrice_ = $_store->roundPrice($_store->convertPrice($item->getPrice()));
        $_convertedBasePrice_ = $_store->roundPrice($_store->convertPrice($item->getPrice()));
        $taxamount = $_taxHelper->getPrice($item, ($price * 0.2), null, null, null, null, null, null, false);
        $baseNewTaxAmount = $_taxHelper->getPrice($item, ($basePrice * 0.2), null, null, null, null, null, null, false);
        $finalprodprice = $_convertedPrice_ + ($_convertedPrice_ * 0.2) + ($taxamount - ($item->getProduct()->getPrice() * 0.2));
        $finalprodBaseprice = $_convertedBasePrice_ + ($_convertedBasePrice_ * 0.2) + ($baseNewTaxAmount - ($basePrice * 0.2));
        $item->setTaxAmount($taxamount - ($item->getPrice() * 0.2));
        $item->setBaseTaxAmount($baseNewTaxAmount - ($item->getPrice() * 0.2));
        $item->setPrice($finalprodprice);
        $item->setPriceInclTax($finalprodprice);
        $item->setBasePriceInclTax($finalprodBaseprice);

        $item->save();
    }
    $order->setSubtotal($finalprodprice)->setBaseSubtotal($finalprodprice);
    $order->setGrandTotal($finalprodprice)->setBaseGrandTotal($finalprodprice);
    $order->setBaseSubtotalInclTax($finalprodprice);
    $order->save();


texts: How do you override Magento\Catalog\Block\Category\View?

texts:
I want to override the protected function _prepareLayout()

So i have used preference

<preference for="Magento\Catalog\Block\Category\View" type="Module\Name\Block\Category\View"/>

class View extends \Magento\Catalog\Block\Product\View
{
    protected $_urlInterface;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Model\Layer\Resolver $layerResolver,
        \Magento\Framework\Registry $registry,
        \Magento\Catalog\Helper\Category $categoryHelper,
        \Magento\Framework\UrlInterface $urlInterface,
        array $data = []
    ) {
        $this->_urlInterface = $urlInterface;
        parent::__construct($context, $layerResolver, $registry, $categoryHelper, $data);
    }

    /**
     * @return $this
     */
    protected function _prepareLayout()
    {
        die(var_dump($this));
        parent::_prepareLayout();

        $this->getLayout()->createBlock(\Magento\Catalog\Block\Breadcrumbs::class);

        $category = $this->getCurrentCategory();
        if ($category) {
            $title = $category->getMetaTitle();
            if ($title) {
                $this->pageConfig->getTitle()->set($title);
            }
            $description = $category->getMetaDescription();
            if ($description) {
                $this->pageConfig->setDescription($description);
            }
            $keywords = $category->getMetaKeywords();
            if ($keywords) {
                $this->pageConfig->setKeywords($keywords);
            }
            if ($this->_categoryHelper->canUseCanonicalTag()) {
                $this->pageConfig->addRemotePageAsset(
                    // $category->getUrl(),
                    $this->_urlInterface->getCurrentUrl(),
                    'canonical',
                    ['attributes' => ['rel' => 'canonical']]
                );
            }

            $pageMainTitle = $this->getLayout()->getBlock('page.main.title');
            if ($pageMainTitle) {
                $pageMainTitle->setPageTitle($this->getCurrentCategory()->getName());
            }
        }

        return $this;
    }

but i get error 500

  PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Magento\Catalog\Block\Product\View::__construct() must be an instance of Magento\Catalog\Block\Product\Context, instance of Magento\Framework\View\Element\Template\Context


texts:
I have generated multiple coupon codes inside the same rule. However, one coupon code is not working. I tried to add that coupon code and it was working but suddenly it stopped working. I also checked in the database and it is not used. It is also not expired.
All other coupons are working fine under the same rule.
Is it stored inside a customer session or something like that?


texts: Magento2.3.1 : Shipping address custom attribute value getting wrong format

texts:
Ref url - Shipping address custom attribute value not getting in RateRequest object in Carrier Model in magento2.x

Above link in working perfect in magento2.2.x but not in magento2.3.1. I checked magento2.3.1 in they have changed something with custom_attribute code.

the issue is reproduce Step below
1. Add to cart product after going checkout Mobile Type select - Local
Estimation shipping rate is - 5 USD and address array passed like

estimate-shipping-methods -
    address:{
    city: "GA"
    country_id: "US"
    custom_attributes: [0: {attribute_code: "mob_type", value: "Local"}]
    firstname: "Test"
    lastname: "Dev"
    postcode: "30049"

.....

Once back to checkout cart page change postcode I am getting an error -

  Error occurred during "custom_attributes" processing. A custom
  attribute is specified with a missing attribute code. Verify the code
  and try again.

I checked post address in estimate-shipping-methods api and found data like

estimate-shipping-methods -
        address:{
        city: "GA"
        country_id: "US"
        custom_attributes: [0: {attribute_code: "0", value: {attribute_code: "mob_type", value: "Local"}}]
        firstname: "Test"
        lastname: "Dev"
        postcode: "30049"

    .....

both custom_attributes arrays is different - so i checked core code and found custom_attributes: [0: {attribute_code: "0", value: {attribute_code: "mob_type", value: "Local"}}] is worng. attribute_code: "0" is extra adding so How can i fix this issue anyone have idea?


texts: In my old Magento 1.7 store, the PayPal Payments Pro configuration asks for api username, api password, and api signature which I can easily get from my paypal account page. In Magento 2, it has changed and now I need partner, vendor, user, password fields instead. I've determined that this is for a PayFlow account but I can't figure out how to use my existing Payments Pro account. Why is it different than before? Do I need to sign up for PayFlow pro instead?


texts: Magento 2 - Calling the SearchCriteriaBuilder in a Collection gives an error

texts:
I am experimenting with Magento 2 and trying to add some filtering in my collection. Hence i am calling the SearchCriteriaBuilder in the constructor.

namespace MyCode\MyBlog\Model\Resource\Post;

use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\Api\FilterBuilder;

class Collection extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection {
    protected $entityFactory;

    protected $logger;

    protected $fetchStrategy;

    protected $_eventManager = null;

    protected $_resource;

    private $searchCriteriaBuilder;

      public function __construct(
        \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        $connection = null,
        \Magento\Framework\Model\Resource\Db\AbstractDb $resource = null,
        SearchCriteriaBuilder $searchCriteriaBuilder
    ) {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);

        $this->searchCriteriaBuilder=$searchCriteriaBuilder;
    }

but this drops me an error.
Missing required argument $connection of MyCode\MyBlog\Model\Resource\Post\Collection.

When i remove the SearchCriteriaBuilder $searchCriteriaBuilder param from the constructor works fine

Any idea why this happens?


texts: Magento 2.4 default select store pickup option on checkout

texts: I am using store pickup of magento 2.4. I want to my store option to be preselected on checkout, as user have to search for it every time. Anyone have done this? https://nimb.ws/VNMWI1


texts:
I'm trying to create a theme for Magento2 installed with composer.
I created the theme of Vendor, registration.php created the file, the view.xml, the composer as well as attached files.
I checked several times the correctness of the data, set the developer mode, disable the cache and rerun the deploy static content, but i do not see the theme from select in backend.

Where am I wrong?


texts:
I would like to do a blur check on the contact form, but it only does the validation on the submit, I would like to know how I make this change.

I'm trying like this

    $j('contactForm').blur(function () {
          if (contactForm.validator.validate()) {
              alert('ok');
          } else {
              alert('no')
          }
     });

But I think I'd have to change the natural code for magento, right?

VarienForm = Class.create();
VarienForm.prototype = {
    initialize: function(formId, firstFieldFocus){
        this.form       = $(formId);
        if (!this.form) {
            return;
        }
        this.cache      = $A();
        this.currLoader = false;
        this.currDataIndex = false;
        this.validator  = new Validation(this.form);
        this.elementFocus   = this.elementOnFocus.bindAsEventListener(this);
        this.elementBlur    = this.elementOnBlur.bindAsEventListener(this);
        this.childLoader    = this.onChangeChildLoad.bindAsEventListener(this);
        this.highlightClass = 'highlight';
        this.extraChildParams = '';
        this.firstFieldFocus= firstFieldFocus || false;
        this.bindElements();
        if(this.firstFieldFocus){
            try{
                Form.Element.focus(Form.findFirstElement(this.form))
            }
            catch(e){}
        }
    },

    submit : function(url){
        if(this.validator && this.validator.validate()){
             this.form.submit();
        }
        return false;
    },
    ...
}


texts: How to get Billing info in custom email template

texts:
I send custom email after place order on that i need to add all order conformation details like product name sku, billing info shipping info except Price i need to get every thing

 $emailTemplate = Mage::getModel('core/email_template');
                    $emailTemplate->loadByCode('Custom New Order');
                    if(!$emailTemplate->getTemplateId()){
                        continue;
                    }
                    $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);

                    $mail = Mage::getModel('core/email')
                        ->setToName($customerName)
                        ->setToEmail('mymail@gmail.com')
                        ->setFromEmail(Mage::getStoreConfig('trans_email/ident_sales/email'))
                        ->setFromName(Mage::getStoreConfig('trans_email/ident_sales/name'))
                        ->setBody($processedTemplate)
                        ->setSubject($emailTemplate->getTemplateSubject())
                        ->setType('html');

         try {
                    $mail->send();
                } catch (Exception $error) {
                    Mage::log($error->getMessage(), null, 'auto_order_emails.log');
                    continue;
                }


texts:
I'm Trying To Create Category Chooser in etc/system.xml
Is That Possible to Create Category Chooser in system.xml ?

Choose Like This


texts: Magento 2: CE integrated ElasticSearch 6 - Autocomplete

texts:
Magento 2.3 Commerce comes with Elastic Search integration.
I want to know, if someone or is it possible to customized the autocomplete feature and be able to search for products and categories like it is nicely done in Smile Elastic Suite

example:

Thanks,
Ajmal


texts: Get products stock quantity in my cart Magento 2

texts: How to get stock quantity for all products in my cart Magento 2 and check if they are in stock or out of stock ?


texts: Filter the configurable products based on the child product's color in Magento 2

texts: In Magento 2 How to filter the configurable products based on the child product's color. For example, if the parent has 4 children with Green, Red, Yellow and Black colors. If I select green in the filter. image of Relevant child product(green) should be visible in place of the parent product image.


texts: Magento : How to use or upload animated .GIF for products and page images?

texts:
I need to upload animated gif for the current site I am working on.
But magento keeps converting it to something else.
What settings are to be changed to upload animated images?


texts: Magento2: Admin dashboard is suddenly logout some times

texts: when I login to the admin dashboard, after some seconds admin is logged out and redirects to the login page. What is this issue?


texts: Magento 2.1.1 how to add version number to css

texts:
I want to add ?v=20170721 after css file

  http://example.com/pub/static/_cache/merged/91eeca7a8ffa88b106ef85bd3a665d93.min.css?v=20170721

I tried to set "yes" in sign static files but this is not what I want

How to force the customers update their CSS in client side?


texts: Magento : Add Info Buy Request Option to Quote Item

texts:
I load quote by quote id and adding items to quote_item table.

I need to know how to add product options i.e. info_buyrequest options to quote item from controller only. I tried below code.

    $quote = Mage::getModel('sales/quote')->load('1125');
    $quote = $quote->setUpdatedAt(now());

    $product = Mage::getModel('catalog/product')->load($product_id);
    $quoteItem = Mage::getModel('sales/quote_item')->setProduct($product)->setQty(1);
    $quote->addItem($quoteItem);

    $additionalOptions = array(
            'label' => 'shop_data',
            'value' => 1
        );

     /* Here the modification is needed */
    foreach($quote->getAllVisibleItems() as $row){
        if($row->getProductId() == 95 ){
            $row->getProduct()->addCustomOption('info_buyRequest', serialize($additionalOptions));
        }
    }

    try{
        $quote->save();
    }catch(Exception $e){
        echo $e->getMessage();
    }


texts: Cannot see new custom Module in Magento 2.1.2

texts:
I am new to Magento, and I am trying to do add my very first module. I tried to follow two tutorials that show how to create a "Hello World" module, which basically shows a 'Hello World!' message on the website; I have installed the sample data. Both sample page and admin page are working fine.
What I have been trying is the following:

Create folder Magentoexplorer (http://magentoexplorer.com/how-to-build-hello-world-magento-2-module-from-scratch)
Inside this folder, there is another folder, 'etc', which has the file module.xml inside of it. In the Magentoexplorer folder I have registration.php. The codes are copied from the example in the link I provided, see them at the end of the post.
In windows CMD (I have Magento 2.1.2 installed over WAMP server), I do php magento setup:upgrade. It seems that it's working. I get the message 'please re-run Magento compile command', though. In a forum I read that this may be not necessary in developer mode. But I tried to do it anyway, just in case. I got the message 'Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in C:\wamp64\www\magento\vendor\zendframework\zend-code\src\Scanner\FileScanner.php on line 36'. I tried to go to php.ini and change the memory_limit to 1G. However, the error kept persisting.
In the tutorials they advice to put code in app/code. In the version I downloaded I don't have this folder; for what I understood, my code is instead in the vendor/magento folder. I tried to put my module in first one folder, then in the other (I created app/code folder).
I modified the magento config.php file adding a line at the end with 'Magentoexplorer_Helloworld' => 1'.
When I tried to list the modules (php magento module:status), it didn't appear. I also tried 'php magento module:enable Magentoexplorer_Helloworld', but I got the error Unknown module(s): 'Magentoexplorer_Helloworld', which disappeared after modifying the config.php file, but then I couldn't see the admin page, nor the module.
I am trying to understand what the composer does and how to use it, but in the tutorials they don't put it as a requisite for the module to be shown.

Is the composer necessary for the module to appear and work? I am new to php and Magento, and I am trying to learn by myself and searched everywhere but I still cannot figure out what is happening. Do you see any errors in what I have been trying? Am I missing something?

Code:

registration.php:

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

module.xml

<?xml version="1.0"? >
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd" >
    <module name="Magentoexplorer_Helloworld" setup_version="1.0.0" / >
</config>

Any help or comment will be much appreciated.

Xavier


texts: duplicate content in different url keys in magento

texts:
in our magento site we created lot of categories and assigned same products to

different categories.

this is url links generating for products in our site.

"www.sitename.com/category1/product 1 "

"www.sitename.com/category2/product 1 "

"www.sitename.com/category3/product 1 "

how to make this like as follows :

"www.sitename.com/product 1 "

please help me to find solution.

thanks in advance.


texts: Question : Magento Cloud Environment With Code Deploy Process

texts:
I have one question.
Your client has a Website in Magento 2 Cloud. Now, Client Wants to see the latest changes happend on Website  so, in which branch developer can merge code for  Client Review
A). Integration
B). Staging
C). Production
D). Developer


texts: How do I call a controller class from a template?

texts:
I have a template, which is included in the transactional email using this code:

{{block type='core/template' area='frontend' template='myname_mymodule/pdffile.phtml' order=$order}}

and in the  pdffile.phtml file i have:

$pdf  =  new Namespace_Module_PdfController();

I get a fatal error with class not found.
Can someone help with this ? thx


texts: Performance issue - slow query in Magento 2

texts:
When I check SHOW PROCESSLIST; in mysql I got below query. It heavily uses CPU (more than 100%). We have a separate server for mysql(64GB RAM).

INSERT INTO `search_tmp_598075de5c7e67_73335919` SELECT `main_select`.`entity_id`, MAX(score) AS `relevance` FROM (SELECT `search_index`.`entity_id`, (((0)) * 1) AS score FROM `catalogsearch_fulltext_scope1` AS `search_index` LEFT JOIN `catalog_eav_attribute` AS `cea` ON search_index.attribute_id = cea.attribute_id LEFT JOIN `catalog_category_product_index` AS `category_ids_index` ON search_index.entity_id = category_ids_index.product_id LEFT JOIN `review_entity_summary` AS `rating` ON `rating`.`entity_pk_value`=`search_index`.entity_id AND `rating`.entity_type = 1 AND `rating`.store_id  =  1 WHERE (category_ids_index.category_id = 2299)) AS `main_select` GROUP BY `entity_id` ORDER BY `relevance` DESC LIMIT 10000

Why it uses my full CPU resources?

Where I find the code to create the above query?


texts: Magento 2 : Show and hide field in custom payment method?

texts:
In my custom payment method there is 1 checkbox as seen below:

In the Admin Settings, if I set it to disable then I don't want to show it.

Following div is for that field.

form.html

          <input name="use3d" id="use3d" value="1" type="checkbox">
          Use 3D secure Payments System

How can I achieve that?


texts: Magento2: shows only one page in products grid

texts:
I see strange error. I import above 20k products and magento shown only 1 page:
https://prnt.sc/uhvxuj
I can switch to show total example: 100 products: https://prnt.sc/uhvy76
and is available 100 products.
When I switch to 900 products, then is available 900 products.
How to solve this issues? Because magento should shown  total 20k records + and multiple pages.


texts: Still Get Reminder Messages Re Security Patch

texts:
I think the patches for the latest security issue with Magento has been installed, but I keep getting messages in the Admin area saying it is critical that I install the patches.

Is this a standard message, or is the message only sent to the Magento stores who have not yet installed the patch?

I would like to know, as I asked the host to do it... Maybe they didn't?


texts: What is the minimum php version for magento 1.9.1

texts:
i finished my website with magento in PHP 5.5 and the website work correctly

but when i moved the website online to my server that run in php 5.3 some errors appeared in search

and i did all that steps to fix the errors
1-flush the cache and log out and in again?
2-Re-index
3-CatalogSearch enabled in config
4-upload all the files

is the error can be from php version or database !!


texts: Magento 2 customer session implementation

texts: anybody know how magento 2 customer session implemented? Is this based on cookie expire time? Or Is this based on PHP Session? Because i encountered an issue while browsing the magento store customer gets sign out automatically.


texts: CatalogSearch - exclude child product names from fulltext

texts:
I've been playing with the catalogsearch for a while, and I'm almost done, but there is one odd thing happening to me. The only "usable in search" attributes are name, child_skus and synonyme. In child_skus, I'm storing the skus of the associated products of my grouped products, as I'm working with grouped products only on the frontend. synonyme contains a list of coma-separated words which related to the said product.

What I'm using for the fulltext search is the following code :

$query = Mage::getModel('catalogsearch/query')->setQueryText($searchText)->prepare();
$fulltextResource = Mage::getResourceModel('catalogsearch/fulltext')->prepareResult(
            Mage::getModel('catalogsearch/fulltext'),
            $searchText,
            $query
        );
$products->getSelect()->joinInner(
            array('search_result' => $products->getTable('catalogsearch/result')),
            $products->getConnection()->quoteInto(
                'search_result.product_id=e.entity_id AND search_result.query_id=?',
                $query->getId()
            ),
            array('relevance' => 'relevance')
        );
$products->getSelect()->order('relevance DESC');

All works fine for now, except that somehow, it also indexes the associated product's name in the fulltext table, which ends up jamming my search because it yields biased results.

Does anyone have any idea on how to change that behaviour, or control it through admin?


texts: Let users use their Magento 1.9 login data to login in my iOS app?

texts:
I'm looking for a way to let users use their login data (e-mail/password) from my Magento 1.9 store (where they are registered already) in my iOS App (built with React Native). I was thinking about a API solution but as far as I know, Magento 1.9 does not offer an user login API, does it?
Any idea how I could make this work? All I need is, let them authenticate in my app and then get their assigned customer group.


texts: Updating Magento 2 product attribute, Import Add/Update feature always create a duplicate new item, instead of updating

texts:
i'm trying to update a custom product attribute called is_eol, but when i use the system->data transfer->import -> import behavior (add/update), it always created a duplicate item with same sku number.

for example, my csv file looks like:

sku, is_eol
abc, eol

where sku:abc is already exist in the catalog.


texts: Magento 2 : Product price should be change on custom option select in custom module

texts:
In my custom module, I display product on model popup. I set custom option in simple product.

When, I select custom option then, product price should also update as like working in product page.

But, currently it's not update product price.

What should I need to do to apply this ?

Any help would be appreciated.

Thanks.


texts:
I'm working on a custom Magento theme and I am stumped on how to remove the span class in the navigation.

I found the file which has it:

Mage => Page => Block => Html => Topmenu.php

I found the span which is in the <A> link but in the header of the file it says not to edit the file in case of a overwrite when updating.

Where would I place this file in my own theme's directory?

Thanks for any help.

Ben :)

P.S. I am using Magento ver. 1.9.0.1


texts: Multiple configurable products as a bundle

texts:
We have many products that we sell in different sizes. We have set up 1 configurable product and linked all the simple product sizes.

But now we wish to set-up a bundled product that consists of a pack of 3 configurable products (like red, green and blue shirt). And when the users for the bundle it should show the same "select size" option as it does with configurable products.

Can this be done?


texts: Magneto2 Paypal Express checkout extra fee not add

texts:
I want to add Extra fee all work fine

but whn i select paypal Express checkout payment method

it not add extra fee to total

http://prntscr.com/ilb0d6

is it possible to add new line to paypal ??

Thanks In advance.


texts: Magento 1.9: How to get the appropriate products attributes details?

texts:
I just display my attributes on the PLP page, but the attributes duplicates or mismatch, actually I am using $attributes = $_product->getAttributes(); for getting appropriate attributes, but my attributes duplicates.

Instead of using this -> $attributes = $_product->getAttributes(); what is the best way to get products attributes.

complete code : https://justpaste.it/290fr   Applied on list.phtml page.


texts:
Currently, the alert links (when product is back in stock and price change alert) are simply wrapped in paragraph tags. I would like to surround both of these paragraph tags with
[default alert urls code here]

I've looked round /base/default for some answers, and have found base/default/template/productalert/product/view.phtml but this only seems to plug the values from `/base/default/layout/productalert.xml - it looks like the phtml file is called twice, which outputs one paragraph tag after another. So I can't add my wrapper div in here.

I have also tried adding a div in /template/catalog/product/view.phtml around this piece of code:

echo $this->getChildHtml('alert_urls');

This works - the div then shows up in the source code - however, I'm using alert.urls as a reference elsewhere and appending another block under it. This causes the appended block to display inside the wrapper div, rather than under it.

So what's the best way to do this? Probably something involving productalerts.xml?


texts: Help please - PHP Warning: include(Extendware/EWCore/Model/Autoload.php): failed to open stream:

texts:
Due to a hack we needed to remove a module, we removed all files but we still have a 500 error. See below. I already removed the recourse in the database and also I turned off compilation through includes/config.php

PHP Warning:  include(Extendware/EWCore/Model/Autoload.php): failed to open stream: No such file or directory in /var/www/vhosts/domain.nl/httpdocs/app/code/core/Mage/Core/functions.php on line 68
PHP Warning:  include(): Failed opening 'Extendware/EWCore/Model/Autoload.php' for inclusion (include_path='/var/www/vhosts/domain.nl/httpdocs/app/code/local:/var/www/vhosts/domain.nl/httpdocs/app/code/community:/var/www/vhosts/domain.nl/httpdocs/app/code/core:/var/www/vhosts/domain.nl/httpdocs/lib:.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/domain.nl/httpdocs/app/code/core/Mage/Core/functions.php on line 68
PHP Warning:  include(Extendware/EWCore/Model/Autoload.php): failed to open stream: No such file or directory in /var/www/vhosts/domain.nl/httpdocs/lib/Varien/Autoload.php on line 93
PHP Warning:  include(): Failed opening 'Extendware/EWCore/Model/Autoload.php' for inclusion (include_path='/var/www/vhosts/domain.nl/httpdocs/app/code/local:/var/www/vhosts/domain.nl/httpdocs/app/code/community:/var/www/vhosts/domain.nl/httpdocs/app/code/core:/var/www/vhosts/domain.nl/httpdocs/lib:.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/domain.nl/httpdocs/lib/Varien/Autoload.php on line 93
PHP Fatal error:  Class 'Extendware_EWCore_Model_Autoload' not found in /var/www/vhosts/domain.nl/httpdocs/app/code/local/Varien/Autoload.php on line 14

I even get these errors when I want to clear compilation or run the index throughs hell php -f compiler.php clear


texts: During the Data migration with Data Migration Tool, the following error as seen in the screenshot is encountered, Is it safe to ignore it

texts: during the Data migration with Data Migration Tool, the following error as seen in the screenshot is encountered. Is it safe to ignore it.


texts: cant set up Germany localization in magento 2

texts:
What i am doing wrong ?
create folder in /www/app/i18n/vendor/de_de/ with this fildes:

--composer.json
--de_de.csv
--language.xml
--registration.php

composer.json:

{
    "name": "vendor/de_de"
    ,"type": "magento2-language"
    ,"description": "Germany language"
    ,"authors": [{
        "name": "John",
        "email": "xxx@xxx.com",
        "role": "Developer"
    }]
    ,"extra": {"map": [["*", "vendor/de_de"]]}
}

language.xml:

<?xml version='1.0'?>
<language xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='urn:magento:framework:App/Language/package.xsd'>
    de_DE
    <vendor>vendor</vendor>
    <package>de_de</package>
</language>

registration.php:

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
   \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
   'vendor_de_de',
   __DIR__
);

after when this files created i run this commands:

php bin/magento i18n:collect-phrases -o app/i18n/vendor/de_de/de_de.csv -m
php bin/magento i18n:pack app/i18n/vendor/de_de/de_de.csv de_DE
php bin/magento cache:clean
php bin/magento setup:static-content:deploy de_DE

but site still on English, please tell me why ?


texts: Content issues with multi-language store in magento2

texts:
I want to create an Arabic store for my website. So I have created a store from the admin panel and applied the Smartwave Porto RTL theme.

Default store is showing all content but in Arabic, some blocks are missing
I am using the Smartwave Porto theme for the website which has multiple sub-theme like demo1 and demo2 so on. I have applied demo5 for my website but when I changed the store from English to Arabic the theme automatically changes (only on Arabic store)

3.when I changed store view to Arabic then again English then it gives an error because of the URL which becomes this after multiple switching

  http:/localhost/test?___store=default?___store=ar

Products name and descriptions are not converting to Arabic so how to translate these automatically

These above issues I am facing


texts:
When i change the limit value, i really want to send the same value to all pages

  vendor/magento/module-catalog/Block/Product/ProductList/Toolbar.php

public function getLimit()
    {

        $limit = $this->_getData('_current_limit');
        if ($limit) {
            return $limit;
        }

        $limits = $this->getAvailableLimit();
        $defaultLimit = $this->getDefaultPerPageValue();
        if (!$defaultLimit || !isset($limits[$defaultLimit])) {
            $keys = array_keys($limits);
            $defaultLimit = $keys[0];
        }

        $limit = $this->_toolbarModel->getLimit();
        if (!$limit || !isset($limits[$limit])) {
            $limit = $defaultLimit;
        }

        if ($limit != $defaultLimit) {
            $this->_memorizeParam('limit_page', $limit);
        }

        $this->setData('_current_limit', $limit);
        return $limit;
    }


texts: Magento 2 - RateRequest Get Checkout Phone Number

texts: The Shipping Courier API requires the Customer Phone Number to get the shipping rates. I'm using RateRequest to get all the information, including the Destination information, but i can't figure out how to get the Phone number. Thank you!


texts: Source class "\Magento\Framework\App\Cache\Tag\Strategy" for "Magento\Framework\App\Cache\Tag\Strategy\Factory" generation does not exist

texts:
I just deployed my site on OVH and by launching the command php bin/magento to check all the magento namespace I come accross this error.

I have already tried to delete the folder var / to see if it could make it work but it seems not.


texts:
Magento2 - In order to increase the speed of the site I need to Compress the CSS & JS. I scanned my site using gtmetrix it says I need to Compress CSS & Js.

How can I achieve this?


texts:
I have tried to install Mailchimp Ext. a lot of times in magento 2 trying the below Ext. https://marketplace.magento.com/mailchimp-mc-magento2.html & https://github.com/mailchimp/mc-magento2 but get the same bellow error, please advice, I am only need to make sync between the subscriber on my magento 2 website and my mailchimp list.
2 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Ebizmarts\MailChimp\Block\Adminhtml\System\Config\Fieldset\Hint
Exception #1 (ReflectionException): Class Ebizmarts\MailChimp\Block\Adminhtml\System\Config\Fieldset\Hint does not exist


texts:
I am posting this as I am still having rounding issues with 1.8 and I want to see am I the only one.

When adding 1 product (£108.33 excl tax/£130 incl tax), it works but if I increase the qty to 2 I get incorrect calculations (£259.99 incl tax). I am stumped as I thought this was fixed in 1.8.

My Cart

These are my tax calculation settings:

I hope you can help.

Thanks,
Paul


texts: Mini Cart Icon dis-appear in mobile menu

texts:
I want help with the menu-cart icon that should be dis-appear in the mobile view in Magento 2.3.5-p1.
so can anyone have an idea please share with me.
Thanks In Advance.


texts:
I'm starting to prepare for the Magento 2 Associate Developer Exam.
Can you help with some tips for this preparation?
Some books, tests, sites or something else?
 Thank you very much.


texts: Magento 2: import large CSV file was not successful

texts:
Magento2 large CSV file was not successfully imported.

I am trying to import 20 Mb products CSV file but was not imported successfully. Still it says "please wait" only.

I have also changed upload_max_filesize = 20M and post_max_size = 20M in  php.ini file and other settings as follows.

max_input_time = 300
max_input_time=300
max_execution _time =300

Need help


texts: Unable to get cart items for a user on login event

texts:
When the user logs in, an event is triggered in the observer.
Event name: customer_login

So I want to get all the cart items of that user who logged in, I did this:
(I had 5 cart items, so it should loop 5 times)

$cart = Mage::getModel('checkout/cart')->getQuote();
        foreach ($cart->getAllItems() as $item) {
            Mage::log("test",null,"test.log");
        }

This same code worked everywhere, but inside the login event it does not work. Nothing gets logged, it doesn't go inside the loop at all.

Then I also tried this instead:

$cart = Mage::getSingleton('checkout/session')->getQuote()
        foreach ($cart->getAllVisibleItems() as $item)

Same thing happened, it doesn't go inside the loop!

Is there any other alternative way?


texts: How to have a specific header for the home page?

texts:
I would like to have specific css parameters for the header of the HomePage.
(a different height and some text displayed)

how can I do that?

(I tried creating a specific .css file and linked it to the homepage vis the CMS admin panel by adding

<reference name="head">
<action method="addCss">
    <stylesheet>css/styles_home.css</stylesheet>
    <params>media="screen"</params>
</action>

the css file is loaded, but the general style.css is also applied and has the last word…)

thank you of your help


texts: Show Magento cart details on Wordpress sites

texts:
I have used Magento and WordPress sits together.My directory structer is like this /Magento and /Magento/WordPress.Now i am trying to get the cart details on WordPress site using above code but its not working.

<?php

require_once  $_SERVER['DOCUMENT_ROOT'].'/app/Mage.php';
umask(0);
Mage::app();

Mage::getSingleton('core/session', array('name'=>'frontend'));
$cart = Mage::helper('checkout/cart')->getCart()->getItemsCount();
 echo 'cart items count: ' . $cart;
 echo ">>",Mage::getModel('checkout/cart')->getQuote()->getItemsQty(); ?>

What i am doing wrong ?


texts:
I recently started working extensively with Magento and Code sniffer, and I would like to know which standards I should follow.

I tried Zend coding standards, but I don't want to use the 80 line limit, and it's not used in the core either.

After that, I tried CS2 standards, but that doesn't work either because of the _ in various functions, and class names, which have an _ in them, and don't have namespaces.

So, is there another standard that the core code complies 100% with ? If not, shouldn't magento have its own coding standards? It has its own stackexchange site, some well defined coding standards would be welcome to be used by extension developers.


texts: Getting current data after calling save()

texts:
I'm experiencing some trouble with saving data to some of my custom columns in the sales_flat_order_payment table.

After quite some time I realized that when I call $this->payment->save(), the data is not actually saved immediately to the database.

For example I get the current time from php with the time() function that returns a number in seconds, I want to save it to the database, which works fine.

Apparently MySql converts the number to the correct string representation. But when I want to pull the same data from the database again after having called save(), I'm not getting the data from the database, but rather the actual unconverted time() value that I saved to the object.

So I'm expecting a date string to call strtotime(), but I get the number in seconds that I inserted earlier. It's even worse when I'm saving a float value that gets rounded in the database but the object still contains the unrounded number.

So is there a way to update the data in the object after calling save()?


texts:
My e-mail system doesn't work. I got no e-mails when im buying products or if I'm getting messages via contact form. I guess my cronjob doesn't work
I read that Scheduler would be a nice extension so I installed it. I got the following message : No heartbeat task found. Check if cron is configured correctly.So how do I do this? I'm using xampp on a windows pc.
My cron settings:

I never edit the cron.sh file


texts: Invalid email - How to allow new domains (ie. .club)

texts:
I've got a magento site running on a new .club domain, but the site owner, cannot seem to use their *@*.club domain email in the admin panel.
When you enter a .club in the Store Email Addresses section, you cannot save them as it error's with invalid email address.

What do I need to edit in js/prototype/validation.js
to allow the new 4-6 character domain names, to be acceptable email addresses for the store?


texts: Magento 2 customer attribute not saved in database

texts:
So I have created an attribute for customer entity, used it in frontend create account form, but it's not showing anything in customer_entity_varchar table, it's empty. However, in eav_attribute table I can see my attribute created.
Here is my code how I create the attribute.
InstallData.php
<?php
namespace Kage\RegisterForm\Setup;

use Magento\Customer\Api\CustomerMetadataInterface;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    /**
     * @var EavSetupFactory
     */
    private $eavSetupFactory;
    /**
     * @var \Magento\Eav\Model\Config
     */
    private $eavConfig;

    public function __construct(
        EavSetupFactory $eavSetupFactory,
        \Magento\Eav\Model\Config $eavConfig
    ) {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig = $eavConfig;
    }

    /**
     * Installs data for a module
     *
     * @param ModuleDataSetupInterface $setup
     * @param ModuleContextInterface $context
     * @return void
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var \Magento\Eav\Setup\EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $setup->startSetup();

        $attributeCode = 'register_zip_code';
        $eavSetup->addAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, 'register_zip_code', [
            'type' => 'text',
            'label' => 'Zip Code',
            'input' => 'text',
            'required' => true,
            'visible' => true,
            'source' => '',
            'backend' => '',
            'user_defined' => true,
            'is_user_defined' => false,
            'sort_order' => 1000,
            'is_used_in_grid' => false,
            'is_visible_in_grid' => false,
            'is_filterable_in_grid' => false,
            'is_searchable_in_grid' => false,
            'position' => 1000,
            'default' => 0,
            'system' => 0,
        ]);

        $eavSetup->addAttributeToSet(
            CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
            CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER,
            null,
            $attributeCode);

        $registerZipCode= $this->eavConfig->getAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, $attributeCode);
        $registerZipCode->setData('used_in_forms', [
            'adminhtml_customer',
            'customer_account_create',
            'customer_account_edit'
        ]);
        $registerZipCode->getResource()->save($registerZipCode);

        $setup->endSetup();
    }
}

Template register.phtml
<fieldset class="fieldset create account" data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>">
    <legend class="legend"><?php /* @escapeNotVerified */ echo __('Additional Information') ?></legend>

        <?php /* @escapeNotVerified */
                echo __('Zip Code') ?>

            <input type="text" name="register_zip_code" id="register_zip_code" title="<?php /* @escapeNotVerified */ echo __('Zip Code') ?>" class="input-text" data-validate="{required:true}">

</fieldset>

After I submit the form, It's not saved.
Greetings!


texts: unable to get shipment collection by order id

texts:
Here is my constructor:

public function __construct(
    //\Magento\Framework\App\Helper\Context $context,
    \Magento\Catalog\Model\Product $product,
    \Magento\Sales\Api\Data\OrderInterface $order,
    \Magento\Sales\Api\OrderRepositoryInterface $orderRepo,
    \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
    \Magento\Sales\Model\ResourceModel\Order\Shipment\CollectionFactory $shipmentCollection
){
    $this->product = $product;
    $this->order = $order;
    $this->orderRepo = $orderRepo;
    $this->searchCriteriaBuilder = $searchCriteriaBuilder;
    $this->shipmentCollection = $shipmentCollection;
    //parent::__construct($context);
}

Here is the code to get order in a function:

$order = $this->order->loadByIncrementId($id);
//$order->getShipmentsCollection(); //nothing also

$shipments = $this->shipmentCollection->create()->addFieldToFilter('order_id', $order->getId())->setOrder('entity_id', 'DESC');

The result is that shipments are empty.

Anyone know how to get the shipments for an order?


texts: Magento 2.3.0 error while changing dropdown attribute to visual swatches

texts:
Fatal error: Uncaught Error: Call to a member function serialize() on null in /vendor/magento/module-swatches/Helper/Data.php:162

Stack trace: #0 /vendor/magento/module-swatches/Model/Plugin/EavAttribute.php(100):

Magento\Swatches\Helper\Data->assembleAdditionalDataEavAttribute(Object(Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor)) #1

/vendor/magento/framework/Interception/Interceptor.php(121):

Magento\Swatches\Model\Plugin\EavAttribute->beforeBeforeSave(Object(Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor))

#2 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor->Magento\Framework\Interception\{closure}()

#3 /generated/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute/Interceptor.php(26): Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor->___ in /vendor/magento/module-swatches/Helper/Data.php on line 162

please help and suggest possible solutions my magento version is 2.3.0


texts: Magento 2 stock inventory is not being updated

texts:
when I placed order in front-end or back-end,

quantities of product is not getting reduced or decremented

When i have checked in admin panel...

Please help me out..

Thanks in advance...


texts:
Magento - foreach simple product show name, sku and stock quantity?

Hi, I am trying to accomplish the following. I would like a simple PHP script to show/export: foreach simple product name, sku, stock quantity, stock status

And pref also for configurable products (same but then summed)

I've come accross many good import scripts, but not a small sript to actually show the current stock status. The problem is that we have an employee who just doesnt understand data profiles etc: the problem arises btw when they have to open FTP to look up the file

https://stackoverflow.com/questions/8533426/daily-inventory-update-through-remote-ftp-file

Question: Any ideas how I can create a small script to show all current stock levels per product?


texts: Custom from-to price filter in layered navigation

texts:
We try to create a custom from-to price filter on our Magento homepage.

We're using a Layered Navigation extension and we can't find a way to understand the price algorithm.

We have two static HTML select boxes. One for the from price and one for the to price. We combine the values from the selected options to one URL with jQuery.

But this unfortunately gives very strange results. Below some examples:

From 10 to 20 gives € 180 - € 200

From 20 to 30 gives € 570 - € 600

From 30 to 40 gives € 1160 - € 1200

How we can access the correct algorithm within our static select option values?

Please see our code below:

<form>

    <select class="price">
        <option value="1">0</option>
        <option value="10">10</option>
        <option value="20">20</option>
        <option value="30">30</option>
        <option value="40">40</option>
    </select>

    <select class="price">
        <option value="">no max</option>
        <option value="10">10</option>
        <option value="20">20</option>
        <option value="30">30</option>
        <option value="40">40</option>
    </select>

</form>

Zoeken


texts: Product Price displaying incorrect(100.000.000,00) in Minicart&Cart for price greater than 1billion

texts:
https://community.magento.com/t5/Magento-2-x-Programming/Price-wrong-greater-than-1-billion/m-p/459543
AS per the screenshot you can see that the product price is 264...... but in price columns it was displaying 100.000....
Please check this link for more info and please suggest any solution.
I have stuck with this issue.

Please help.


texts:
Can't seem to figure out how to remove the following fields from the Billing step:

1) Register with us for future convenience
2) Ship to this address
3) Ship to different address

I am trying to change the billing.phtml to comment out the fields not needed but having no luck on the front-end. Even after clearing cache, reindex etc... nothing is changed.

So far I have tried to modify the billing.phtml files in the following locations:

design/frontend/rwd/default/template/persistent/checkout/billing.phtml
design/frontend/base/default/template/checkout/onepage/billing.phtml
design/frontend/base/default/template/persistent/onepage/billing.phtml

Where can I edit the billing page so I can remove unneeded fields?


texts: How to get not get an error if custom image attribute image isn't there?

texts:
I'm trying to add an image link to the head of my pages. This code below works except if the image isn't there, I've tried a lot of different ways but no luck.  The part <?php echo $this->getImage(); ?> works fine on it's on but it doesn't get the correct image, so I'm using it to fall back on if the other image isn't there. But I keep getting errors and the page goes blank if the image isn't there. Here's my latest attempt.

<?php if (($this->helper('catalog/image')->init(Mage::registry('current_product'), 'twitter_image')) != null): ?>
    <?php $twitter_image = $this->helper('catalog/image')->init(Mage::registry('current_product'), 'twitter_image'); ?>
    <?php if ($twitter_image): ?><?php echo $twitter_image; ?>
    <?php else: ?>
    <?php echo $this->getImage(); ?>
    <?php endif; ?>
    <?php endif; ?>

Any suggestions?

Thanks


texts:
I am using magento 2.1.0 and i am trying to redirect customer to account edit page after login  instead of home page of dashboard after login

For this i created one plugin for login post and define that plugin in di.xml

Plugin Code:

<?php

namespace xxxx\xxxx\Plugin;

 class LoginPost
 {

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

/**
 * @param \Magento\Framework\UrlInterface $url
 */
public function __construct(
    \Magento\Framework\UrlInterface $url
)
{
    $this->url = $url;
}

public function afterExecute(
    \Magento\Customer\Controller\Account\LoginPost $subject,
    $resultRedirect
) {
    $resultRedirect->setUrl($this->url->getUrl('customer/account/edit'));
    return $resultRedirect;
}
 }

What i am doing wrong or miss something???


texts: Magento 2 -How develop form using ui_component on Frontend?

texts:
I am Looking for Form using ui_component on Frontend in which use all UI Component like date, checkbox etc all.

I am still not found any complete guideline about the ui_component form on frontend and also CURD operation.

Can anyone suggest me any perfect link?

Thanks in advance..!


texts: What css is causing my footer to take over the whole body?

texts: I have page in which in responsive on any browser at 768 width everything in the footer looks fine. If you go to 767 the footer goes up the the header and everything is terrible. How can I make that stop?


texts: "There has been an error processing your request" while moving to server

texts:
I have created my magento website on my localhost with magento 1.9.x. With windows 7 and xaamp server.
URL was

  127.0.0.1/demo

Database name was

  demo

Now I want to move it from localhost to my server.. Steps I took to do it are

  I have put my Magento in directory example.com/MyMagentoProject

  Clear the cache manually

  Made changes in app/etc/local.xml

  database Name changed to magentoproject

Now my website giving me below error

  There has been an error processing your request

  Exception printing is disabled by default for security reasons.

  Error log record number: 192262631357

Error log number changes everytime when i refresh page... i have refreshed tons of time each time the error code is diffrent

what is the problem?

(NOTE) if it helps
when I was exporting my database from localhost/phpmyadmin it gave me error

  Warning: a form on this page has more than 1000 fields. on submission,
  some of the fields might be ignored, due to PHP's max_input_vars
  configuration.

so I have changed max_input_vars = 1000 to max_input_vars = 10000 and exported my database. but while importing database to server it took around 10 mints to upload my database but no error


texts: Magento2 : List page product shuffle evertime when page refresh

texts:
When I go to product list page, products shuffle every time whenever I refresh the page or visit another category.

How to fix this issue? Is this default or I can make changes from admin?

Help me.


texts:
I want split order from cart items, for example if anyone add to cart any product then in cart, there is two item added in my website. first is main item in cart and second is security deposit item, so when we do place order then order will be split and in payment method(authorized.net) - payment should be initialised for both order.
Please help me for that, anyone have idea for that


texts: Magento 2: Create products attributes programatically, without install script

texts: How to create product attributes in Magento 2 so it works in running script without install script


texts: Checking Multiple Attributes for specific value

texts:
Hi we're trying to check the value of multiple custom attributes before showing some text... I have made sure that each attribute is set with the option "Visible on Product View Page on Front-end" set to YES.

I also made sure my test product has all the following attributes with the following values set
damage_front = FRONT: No damage
damage_right = RIGHT SIDE: No damage
damage_left = LEFT SIDE: No damage
damage_back = BACK: No damage
damage_handles = HANDLES: No damage

I then added the below code to my product view page...

<?php if ($_product->getAttributeText('damage_front') == "FRONT: No damage" && $_product->getAttributeText('damage_back') == "Back: No damage" && $_product->getAttributeText('damage_right') == "RIGHT SIDE: No damage" && $_product->getAttributeText('damage_left') == "LEFT SIDE: No damage" && $_product->getAttributeText('damage_top') == "TOP: No damage" && $_product->getAttributeText('damage_handles') == "HANDLES: No damage"): ?>
{
echo "
This Product is Box Damaged Only
";
}
<?php endif; ?>

Unfortunatly this does not show any text output, so just to test further i reduced the statement to just check one attribute...

<?php if ($_product->getAttributeText('damage_front') == "FRONT: No damage") : ?>
{
<?php echo "
This Product is Box Damaged Only
"; ?>
}

<?php endif; ?>

This still doesnt show the required Box Damaged only text.

Finally just to test, i removed the whole IF statment and added

<?php echo "
This Product is Box Damaged Only
"; ?>

As expected this does show the text in the correct position on the product view page, can anyone please show me where i'm going wrong to check all the attribute values and show text if they match?

edit: since checking another similar post i have also tried the following...

<?php if ($_product->getData('damage_front') == "FRONT: No damage" && $_product->getData('damage_back') == "Back: No damage" && $_product->getData('damage_right') == "RIGHT SIDE: No damage" && $_product->getData('damage_left') == "LEFT SIDE: No damage" && $_product->getData('damage_top') == "TOP: No damage" && $_product->getData('damage_handles') == "HANDLES: No damage"): ?>

The suggested answers on the other post do not rectify this issue and therefore i think it's a different problem altogether.

EDIT: Ok I've managed to fix my own problem and here's how i did it...

    <?php
if ($_product->getData('damage_front') == "FRONT: No damage" && ($_product->getData('damage_back') == "BACK: No damage" && ($_product->getData('damage_right') == "RIGHT SIDE: No damage" && ($_product->getData('damage_left') == "LEFT SIDE: No damage" && ($_product->getData('damage_top') == "TOP: No damage" && ($_product->getData('damage_handles') == "HANDLES: No damage")))))):
 ?>

Box Damaged Only.

                              This item is in perfect condition and only has box damage.

<?php endif;?>


texts:
I am trying to create promotional pages for our magento site to run marketing campaigns from. It is very important for us to be able to share these pages on social, which means editing the open-graphs for each page so the correct image appears etc.

Is there any way for me to access the header HTML for individual pages so I can input my own meta-tags?

So far I can only add text for title and description in the back end, but images for individual pages (other than product pages) aren't proving to easy, unless I'm missing something?


texts: Magento2 : sales_payment_transaction table not updating

texts:
I'm creating a custom payment module in magento2 and create success controller, I want to update order status and transaction. My code as below :

// create invoice : this is working
$invoiceService = $this->_objectManager->get('Magento\Sales\Model\Service\InvoiceService');
$invoice = $invoiceService->prepareInvoice($order);
$invoice->register();
$invoice->save();

// update order status : this is working
$order->setState(\Magento\Sales\Model\Order::STATE_PROCESSING, true);
$order->setStatus(\Magento\Sales\Model\Order::STATE_PROCESSING);
$order->addStatusToHistory($order->getStatus(), 'Tseting : Order processed successfully with reference '. $tracking_id);
$order->save();

// make transaction : this is not working
$payment = $order->getPayment();
$payment->setLastTransId($tracking_id);
$payment->setTransactionId($tracking_id);
$formatedPrice = $order->getBaseCurrency()->formatTxt(
    $order->getGrandTotal()
);

$trans = $this->_objectManager->get('Magento\Sales\Model\Order\Payment\Transaction\Builder');

$message = __('The authorized amount is %1.', $formatedPrice);
$transaction = $trans->setPayment($payment)
->setOrder($order)
->setTransactionId($tracking_id)
->setFailSafe(true)
->build(\Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE);

$payment->addTransactionCommentsToOrder(
    $transaction,
    $message
);
$payment->setParentTransactionId(null);
$payment->save();

sales_payment_transaction table not updating from above code.

How to complete my transaction after payment success?


texts: is there an official doc planning how to create a module

texts:
I've spent several hours reading magento 2's official documentation, and I haven't found how to create a module :

The documentation explain the structure of the filesystem, list the files that we can create in some directories (for example here),
The exprected content of the composer.json module.xml and registration.php are well explained (several times),
I've found some informations about the possibles entries in the configuration files (app/etc/*.xml),
But I've didn't found a comprehensive explanation of all the content of the files (controller, view, layout, model, setup, ...).
Did I missed something or all this area isn't covered by the doc?

the best ressource found untill now is this one : Creating a Magento admin page (but it do not cover all the need, for example, I want to learn how to add an "array" of custom data about the customer)

edit : I add what I try to do in order to show that it is not covered by the doc :
add an "array" of custom data to the customer thoses data will permit to buy or not the products

How to add thoses custom data :  not covered (I think that I need to alter the data model to add new tables, in the setup file of the module)
How to request thoses data in the frontend :  not covered
How to view/edit those data in the admin :  not covered
How to let the customer edit thoses data :  not covered
How to create REST API (wich will permit thoses data to be populated by a remote system) :  not covered


texts: .lib-url-check is undefined Magento 2.3 static content deploy error

texts:
Magento 2.3 when deploying static content this error occurs:

  Compilation from source: /var/www/html/MyProject/vendor/magento/theme-frontend-blank/web/css/styles-m.less
      .lib-url-check is undefined in /var/www/html/MyProject/var/view_preprocessed/pub/static/frontend/Magento/mytheme/nb_NO/css/source/lib/_icons.less in _icons.less in _module.less

And I believe due to the undefined mixin, styles-m.css is not generated as well prompting this:

  The contents from the
  "/var/www/html/MyProject/pub/static/frontend/Magento/mytheme/nb_NO/css/styles-m.css" file can't be read. Warning!file_get_contents(/var/www/html/MyProject/pub/static/frontend/Magento/mytheme/nb_NO/css/styles-m.css): failed to open stream: No such file or directory

pub/static has .htaccess so this is not the cause.
 What else could it be, how to fix this?
 My theme parent theme is blank.

UPDATE:
If anyone might get this error heres fix, in custom theme web/css/source/lib/_icons.less this code:

._lib-icon-image(
@_icon-image,
@_icon-image-width,
@_icon-image-height,
@_icon-image-margin,
@_icon-image-vertical-align,
@_icon-image-position-x,
@_icon-image-position-y
) {
.lib-url-check(@_icon-image);

.lib-css(background-image, @lib-url-check-output); // @lib-url-check-output is a returned variable of .lib-url-check() mixin
.lib-css(background-position-x, @_icon-image-position-x);
.lib-css(background-position-y, @_icon-image-position-y);
.lib-css(line-height, @_icon-image-height);
.lib-css(margin, @_icon-image-margin);
.lib-css(vertical-align, @_icon-image-vertical-align);
._lib-icon-image-size(
    @_icon-image-width,
    @_icon-image-height
);

Needs to be updated to:

._lib-icon-image-url(@_path) when not (@_path = false) {
.lib-css(background-image, url(@_path));
}

._lib-icon-image(
@_icon-image,
@_icon-image-width,
@_icon-image-height,
@_icon-image-margin,
@_icon-image-vertical-align,
@_icon-image-position-x,
@_icon-image-position-y
) {
._lib-icon-image-url(@_icon-image);
.lib-css(background-position-x, @_icon-image-position-x);
.lib-css(background-position-y, @_icon-image-position-y);
.lib-css(line-height, @_icon-image-height);
.lib-css(margin, @_icon-image-margin);
.lib-css(vertical-align, @_icon-image-vertical-align);
._lib-icon-image-size(
    @_icon-image-width,
    @_icon-image-height
);

After this static content compiles with no errors.


texts: How to extract one of the properties from an object as an array in PHP?

texts:
I have an object that looks like below. I would like to pull out just the "DID" property as an array. How would I go about that in PHP?

stdClass Object
(
[t] => Array
    (
        [0] => stdClass Object
            (
                [DID] => 0722459
                [ForwardingNumber] => 13479330
            )

        [1] => stdClass Object
            (
                [DID] => 072562
                [ForwardingNumber] => 1443997
            )

        [2] => stdClass Object
            (
                [DID] => 0722876
                [ForwardingNumber] => 1845638
            )


texts: Filter product collection by group product child count.

texts:
I need to be able to filter a product collection for grouped products that is not the issue i also need to filter the collection by grouped products that have a specific number of child products.

Any help would be appreciated been wrapping my brain arround this one today.

Regards


texts: Upgrading from Magento 1.4.0.1 to 2.0.17

texts:
My clients have a very old Magento store (1.4.0.1, from 2010) and they'd like to upgrade and use a theme that works with Magento CE 2.0.X.

I have installed a fresh Magento 2.0.17, with an empty database.

What would you recommend to bring the old site (1000 products, 3 stores/languages, 8 years of clients) to the new site?

I have been browsing the Data Migration Tool but it seems it doesn't support such an old version.

Thanks,


texts: Please specify product's required option(s) magento 2

texts:
I am adding product into my cart through productid and qty but when i load into cart it's displaying this message.
Please specify product's required option(s).

 <?php
namespace Racom\Chatbotapi\Model;

use Racom\Chatbotapi\Api\ChatbotapiInterface;

class Chatbotapi implements ChatbotapiInterface
{

    protected $order;
    protected $cart;
    protected $session;
    protected $product;

    public function __construct(
        \Magento\Sales\Model\Order $order,
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Checkout\Model\Session $session,
        \Magento\Catalog\Model\Product $product
    ) {
        $this->order = $order;
        $this->cart = $cart;
        $this->session = $session;
        $this->product = $product;
    }

    /**
     * This fuction performs the reorder operation.
     *
     * @api
     * @param Integer $orderId order Id.
     * @param Integer $customerId customer Id.
     * @return string Successfully reordered.
     */
    public function reOrder($orderId,$customerId)
    {
        try{
            $productCollection = $this->order->load($orderId);
            //If customer's id is equal then load the order.
            if($customerId == $productCollection->getData('customer_id'))
            {
                $order = $this->order->load($orderId);  //Load an order by $orderId.
                $orderInformation = $order->getData();  //Getting data of a particular order by $orderId.
                $orderAllItems = $order->getAllItems();
                foreach ($orderAllItems as $item)
                {
                    $options = $item->getProductOptions();
                    print_r(json_encode($options));         //For getting the options of product.
                    print_r(json_encode($orderInformation)); //For getting information of order
                }
                $param = array();
                //Total quantity of an order
                $param['qty'] = $orderInformation['total_qty_ordered'];
                //product item options
                $param['options'] = $options;
                //for getting product id.
                $productId = $item->getId();
                $product = $this->product->load($productId);
                if ($product)
                {
                    //This is where I am getting message that "Please specify product's required option(s)".
                    $this->cart->addProduct($product,$param);
                    $this->cart->save();
                    return json_encode("Successfully added product into shopping cart.");
                }
            }
            else
            {
               return json_encode("customerId and orderId not match.");
            }
        }
        catch (Exception $e)
        {
            return "Can't add product into cart";
        }

    }


texts:
I'm currently trying to validate if FPC is working properly, however I'm getting results I don't fully understand.

If I'm in developer mode and have a clear cache I can see the following headers:

X-Magento-Cache-Debug:MISS
X-Magento-Cache-Control:max-age=86400, public, s-maxage=86400

On a pagereload I get a:

X-Magento-Cache-Debug:HIT

So this leads to the assumption that everything is working out fine. However the actual Cache-Control Header is always set to be:

Cache-Control:max-age=0, must-revalidate, no-cache, no-store

I thought that might just be because of developer mode, so I changed to deployment mode and expected the Cache-Control header to be:

Cache-Control:max-age=86400, public, s-maxage=86400

But as mentioned before I just got:

Cache-Control:max-age=0, must-revalidate, no-cache, no-store

Shouldn't the X-Magento-Cache-Control relate to the actual Cache-Control value? I currently not sure how the Magento FPC should Work but I'm assuming that this isn't the correct behavior and would not work if I will switch the FPC to use varnish. Any input on what is causing this issue will be appreciated.


texts: City load According Country wise In magento2

texts: I want to city load on the checkout page when customer Select Country / State then City load accordingly, So anyone has the best idea how to do this or any extension have like this, please suggest me!


texts:
I have a array with following structure in ko template

 styleBasedProductsDetails = {{
                "image_url": "media/images/home-page/1.jpg",
                "link_url": "push-up-bra-online/"
            },
            {
                "image_url": "media/images/home-page/5.jpg",
                "link_url": "push-up-bra-online/"
            },
            {
                "image_url": "media/images/home-page/2.jpg",
                "link_url": "bra-online/underwired-bra/"
            }}

How to split each element in this array like... styleBasedProductsDetails[0]['link_url'] without using foreach


texts: Magento2 : How to get product custom option Title from its ID

texts:
In a magento2 plugin I would like to get the product custom options title from the option ID, but I do not know what injection to make in the constructor and what functions to use to achieve that...

$option_id=13;
$option_Title=$this->..->getTitle($option_id);


texts: Magento 1.9 how to create custom frontend page programmatically

texts:
I am beginner in Magento. I want to create a page and show all products in it with this URL: example.com/products.

I've read many tutorials and answers, Is there any tutorial that could help me to create a custom page programmatically from scratch?


texts:
My website is live website and its working fine until yesterday I am unable to access admin panel. I dont know how to fix it. Even after login it stays on the same login page

I tried all possible following solutions, none working, My site is on cloudflair

I updated the

  app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

// session cookie params
    $cookieParams = array(
        'lifetime' => $cookie->getLifetime(),
        'path'     => $cookie->getPath() //,
    // 'domain'   => $cookie->getConfigDomain(),
    //  'secure'   => $cookie->isSecure(),
   //   'httponly' => $cookie->getHttponly()
    );

edit these setting to null as well

error log

[07-Nov-2017 05:46:23 UTC] PHP Fatal error:  Uncaught exception 'Exception' with message 'File '/home/abc/public_html/media/catalog/product/cache/1/thumbnail/300x400/85e4522595efc69f496374d01ef2bf13/6/4' does not exists.' in /home/abc/public_html/lib/Varien/File/Transfer/Adapter/Http.php:96
Stack trace:
#0 /home/abc/public_html/get.php(205): Varien_File_Transfer_Adapter_Http->send('/home/abc/...')
#1 /home/abc/public_html/get.php(165): sendFile('/home/abc/...')
#2 {main}
  thrown in /home/abc/public_html/lib/Varien/File/Transfer/Adapter/Http.php on line 96
[07-Nov-2017 05:46:27 UTC] PHP Fatal error:  Uncaught exception 'Exception' with message 'File '/home/abc/public_html/media/catalog/product/cache/1/thumbnail/300x400/85e4522595efc69f496374d01ef2bf13/8/g' does not exists.' in /home/abc/public_html/lib/Varien/File/Transfer/Adapter/Http.php:96
Stack trace:
#0 /home/abc/public_html/get.php(205): Varien_File_Transfer_Adapter_Http->send('/home/abc/...')
#1 /home/abc/public_html/get.php(165): sendFile('/home/abc/...')
#2 {main}
  thrown in /home/abc/public_html/lib/Varien/File/Transfer/Adapter/Http.php on line 96


texts: What are the differences between the promotion actions?

texts:
I've two location to set my cart promotion rules, what are the differences?

I can set the rules in Conditions and Actions.

For example:

Conditions tab

Actions Tab


texts: Redirected to the Homepage when removed www. from URL

texts:
Say, My Website is : www.example.com

I have one page : www.example.com/contactus

If I remove "www." from above url, means : example.com/contactus

It redirects me to the homepage. Why ??

Checkout Following Image of .htaccess :

What is the Solution for it ??

What changes i have to make in .htaccess


texts:
Magento facing indindex issue, please check with below url -

CommandNotFoundException ERROR
My Screenshot KALİ: https://image.ibb.co/gu6fWb/Screenshot_from_2017_12_29_03_05_41.png
HELP THANX GUYS


texts: Can I use one observer named "checkout_onepage_controller_success_action" in two different custom modules?


texts: Can't Update product attribute from magento admin panel

texts:
After editing short description from magento admin panel and clicking on save, it shows message that it was saved successfully, but the short description was same before editing. I hope this issue is because of store view.

But to change short description if the store view is changed from default to some other then it gets updated, but i cant change its value for all store views

Has anyone else experienced this, and, what am I doing wrong?


texts: Magento2 | MassAction Filter instance none given

texts:
I'm getting strange error when I want to use mass action in a grid :

AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: Argument 2 passed to Toto\\Helloworld\\Controller\\Adminhtml\\Page\\MassDelete::__construct() must be an instance of Magento\\Ui\\Component\\MassAction\\Filter, none given

See my Controller MassAction file :

namespace Toto\Helloworld\Controller\Adminhtml\Page;

use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Toto\Helloworld\Model\ResourceModel\Contact\CollectionFactory;

class MassDelete extends \Magento\Backend\App\Action
{
protected $filter;
protected $collectionFactory;

public function __construct(Context $context, Filter $filter, CollectionFactory $collectionFactory)
{
    $this->filter = $filter;
    $this->collectionFactory = $collectionFactory;
    parent::__construct($context);
}

public function execute()
{
    $collection = $this->filter->getCollection($this->collectionFactory->create());
    $collectionSize = $collection->getSize();

    foreach ($collection as $contact) {
        $contact->delete();
    }

    $this->messageManager->addSuccess(__('A total of %1 record(s) have been deleted.', $collectionSize));

    $resultRedirect = $this->resultRedirectFactory->create();
    return $resultRedirect->setPath('*/*/index', array('_current' => true));
}
}

Do you know why ? It looks like the namespace use Magento\Ui\Component\MassAction\Filter; is not detected.
Thanks in advance


texts:
I saw this code in app/code/core/Mage/Catalog/etc/config.xml file. Can anyone explain what is the <deprecatedNode> node mentioned here ?

<config>
. . . . . .
<global>
        <models>
            <catalog>
                <class>Mage_Catalog_Model</class>
                <resourceModel>catalog_resource</resourceModel>
            </catalog>
            <catalog_resource>
                <class>Mage_Catalog_Model_Resource</class>
                <deprecatedNode>catalog_resource_eav_mysql4</deprecatedNode>
                <entities>
                    <product>

catalog_product_entity

                    </product>
                       . . . . . .
</global>
. . . . . .
</config>


texts: When uploading product image i get "upload HTTP error"

texts:
When I want to upload product image I get an error:

  upload HTTP error


texts: Magento 2 OWL carrousel filtered by custom attribute

texts:
I am trying to get the OWL carrousel to show products filtered by a custom attribute that I added.

This filter option is not supported by default. Does anybody know a good way to fix this?


texts:
i am writing my extension and i have troubles in my extension layout xml file. I need override my_theme/catalog/product/list.phtml to my_theme/myextension/mylist.phtml

I am trying to write the next code:

<?xml version="1.0"?>
<layout version="0.1.0">
     <catalog_category_layered>
         <reference name="catalog_product_list">
             <action method="setTemplate">
                 <template>myextension/mylist.phtml</template>
             </action>
         </reference>
     </catalog_category_layered>
 </layout>

But this no working. Help me please


texts: migrate previous magento into new magento

texts:
Hi i want to know how to migrate previous magento customers details with purchases into new magento 2.1 store.
I have tried to look into the database, but was not able to find the required details.
Actually I have re-designed my website, the older website is in Magento 1.9 and I want to migrate all the previous registered users, their details and their purchase history into my new website developed on magento 2.1
Kindly advice how this can be done.


texts: How to get admin config values from a specific store view

texts:
Currently, I'm getting my values like:

$this->_scopeConfig->getValue('settings/basics/language', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

But this, of course, gets me the default value.

How do I get the config value of a certain store view?


texts: Set default option as "No" for custom select attribute

texts:
I have used below code to generate a custom select attribute.

$installer->addAttribute('catalog_product', "best_seller_flag", array(
    'type'       => 'int',
    'group'      => 'Flags',
    'input'      => 'select',
    'label'      => 'Best seller flag',
    'default'    => '',
    'sort_order' => 2,
    'required'   => false,
    'global'     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'backend'    => 'eav/entity_attribute_backend_array',
    'option'     => array (
        'values' => array(
            0 => 'No',
            1 => 'Yes'
        )
    ),
));

$installer->addAttribute('catalog_product', /* another attribute */);

$installer->addAttribute('catalog_product', /* another attribute */);

The attribute was created successfully but by default "No" option is not selected. It is showing in admin panel as shown in the below image:

When I inspect the element, I can see the following code (related to a single attribute)

<select class=" select" name="product[best_seller_flag]" id="best_seller_flag">
    <option selected="selected" value=""></option>
    <option value="156">No</option>
    <option value="157">Yes</option>
</select>

As you can see in above code, the values of options are not 0 and 1, instead they are some numbers like 156 and 157.

I think this is the main reason to why the 'default' => '' is not working. (even tried 'default' => '0')

Please help