texts: Magento sub-categories listing on category pages cache issue

texts:
I have the following static block to display my sub-categories in the categories page:

<?php
$_categories=$this->getCurrentChildCategories();
if($_categories->count()):
    $categorycount = 0;
foreach ($_categories as $_category):
    if($_category->getIsActive()):
        $cur_category=Mage::getModel('catalog/category')->load($_category->getId());
    $layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$catName = $this->getCurrentCategory()->getName();
if ($categorycount == 0){
    $class = "first";
}
elseif ($categorycount == 3){
    $class = "last";
}
else{
    $class = "";
}
?>
<li class="item <?php echo $class?> dropshadowclass">
<a class="product-image" href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><img src="<?php echo $_category->getImageUrl() ?>" width="100%" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" />

<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?>

<?php
endif;
if($categorycount == 3){
    $categorycount = 0;
    echo "
\n\n
";
}
else{
    $categorycount++;
}
endforeach;
endif;
?>

Also, have amended the method getCurrentChildCategories() to:

 $layer = Mage::getSingleton('catalog/layer');
    $category   = $layer->getCurrentCategory();
    /* @var $category Mage_Catalog_Model_Category */
    $collection = Mage::getModel('catalog/category')->getCollection();
    /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
    $collection->addAttributeToSelect('url_key')
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('is_anchor')
        ->addAttributeToSelect('image')
        ->addAttributeToFilter('is_active', 1)
        ->addIdFilter($category->getChildren())
        ->setOrder('position', 'ASC')
        ->joinUrlRewrite()
        ->load();

    $productCollection = Mage::getResourceModel('catalog/product_collection');
    $layer->prepareProductCollection($productCollection);
    $productCollection->addCountToCategories($collection);
    return $collection;

However, my issue is that the cache, in particular Blocks HTML output cache is caching the sub-categories of the first category page when I visit and then displaying them for any other subsequent category pages.

Would anyone be able to kindly myself identify what is causing this issue ?


texts: Fatal error: Class 'Mage_Framework_Helper_Data' not found in app/Mage.php When creating User Roles

texts:
I encountered a "Fatal error: Class 'Mage_Framework_Helper_Data' not found in /var/www/latest/app/Mage.php on line 547" when I clicked on create user roles.

Please I need your help on how to solve this issue.

Thanks.


texts: Magento Admin Header above phtml Content?

texts:
Currently in the Admin Panel my custom phtml page is under the header:

app/code/local/Sean/MasterCreate/Block/Adminhtml/Warehouse/Display.php

<?php

class Sean_MasterCreate_Block_Adminhtml_Warehouse_Display extends Mage_Adminhtml_Block_Widget_form_Container
{
    public function __construct()
    {
        $this->_objectId = 'product_id';
        $this->_blockGroup = 'mastercreate';
        $this->_controller = 'adminhtml_warehouse';
        $this->_mode = 'display';

        $this->setTemplate('finance/action.phtml');

        parent::__construct();
    }

    public function getHeaderText()
    {
        return Mage::helper('mastercreate')->__('MYJ Finance / Inventory');
    }

    //This is automatically tied to where the form action goes/is
    public function getSaveUrl()
    {
        return $this->getUrl('*/warehouse/updateInventory');
    }
}

The getHeaderText() function puts the header text under my phtml page created through the following:
app/design/adminhtml/default/default/layout/finance.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <adminhtml_warehouse_createwarehouseform>
        <reference name="content">
            <block type="adminhtml/template" name="warehouse_display" template="finance/action.phtml" />
        </reference>
    </adminhtml_warehouse_createwarehouseform>
</layout>

app/design/adminhtml/default/default/template/finance/action.phtml

<!doctype html>

    <meta charset="utf-8">

    <title>MYJ Finance Page</title>

    <link rel="stylesheet" href="">

Hello

app/code/local/Sean/MasterCreate/controllers/Adminhtml/WarehouseController.php

<?php

class Sean_MasterCreate_Adminhtml_WarehouseController extends Mage_Adminhtml_Controller_Action
{
    public function createWarehouseFormAction()
    {
        $this->loadLayout();
        $this->renderLayout();
        $this->_addContent(
            $this->getLayout()->createBlock('mastercreate/adminhtml_warehouse_display')
        );
        $this->_initLayoutMessages('adminhtml/session'); //this will allow flash messages
    }
}

Where do I specify what comes first?  I can edit to display additional files if necessary just let me know!


texts: Add additional information to payment method

texts:
I'm trying to add additional data to the checkmo  payment method. I then need this additional data appear at the order Endpoint.

I plan on using this as a way of passing over a sort code / account number for direct debit payments.

I have a system set up that places orders for Magento 2 with the API. A user enters name / address etc and this is sent over using the API.

For payment method I need to pass over sort code / account number. Rather than creating a custom payment method for this, I would like to try and shoehorn this information into an existing one that won't be used on the actual Magento 2 site.

The issue seems to be actually adding data into this,

The Swagger documentation seems to have -

payment": {
"account_status": "string",
"additional_data": "string",
"additional_information": [
  "string"
],

I have tried using this -

{
"paymentMethod": {
"method": "checkmo",
"additional_data": {
"sortcode" :"00-00-00",
"account_number" : "12345678"
   }
 }
}

But this still comes out at the Endpoint as -

"payment": {
    "account_status": null,
    "additional_information": [
        "Check / Money order",
        null,
        null
    ],

If I try to use additonal information instead -

{
"paymentMethod": {
"method": "checkmo",
"additional_information": {
"sortcode" :"00-00-00",
"account_number" : "12345678"
 }
}

I get the error

Message: Property "AdditionalInformation" does not have corresponding setter in class "Magento\Quote\Api\Data\PaymentInterface".

Is there anyway to add this to an order preferably using checkmo payment method, and then have it appear at the endpoint?


texts: Issues in installing data migration tool to migrate from Magento 1.9.0.1 to Magento 2.1.0

texts:
I have installed Magento 2.1.0, I tried Install the Data Migration Tool , I tried Install the tool from GitHub by using

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

On running 2nd command, I am getting,

what am I missing? I am using OS X Yosemite 10.10.5 , php 5.6.10 and MySQL 5.6.25


texts: Integration test cron job is not running

texts:
I want to test code with integration test that uses cron. The code, what runs by integration test, creates entry to cron_schedule table, but cron does not run created cron-job when it is designated. Why?

How can I run cron-job that is located in integration database programmatically?
Does correctly configured cron also can run cron-job in integration test database?


texts: Where can i get patch SUPEE-3941 for installing SUPEE-8788 Magento 1.13.1 EE?

texts:
I tried to install SUPEE-8788 through this manual:

But can't find patch SUPEE-3941. Where can i find it?
Thanks


texts:
I am get successful massage after import,  Check with backend there is no images.
Magento Version : 1.9.2.3


texts: How to add tracking number to ShipOrderInterface programmatically

texts:
How can I passed the tracking number to the Model \Magento\Sales\Api\ShipOrderInterface. The method is working with a empty array.

this is the code I've made for testing, but it's not working:

<?php
namespace Maru3l\SyncOrchestra\Cron;

use \Psr\Log\LoggerInterface;
use \Magento\Framework\App\Helper\Context;
use \Magento\Framework\App\Helper\AbstractHelper;
use \Magento\Sales\Api\OrderRepositoryInterface;
use \Magento\Framework\Api\SearchCriteriaBuilder;
use \Magento\Sales\Api\ShipOrderInterface;

class SyncOrder extends AbstractHelper
{
    protected $logger;
    protected $sourceItemInterface;
    protected $orderRepository;
    protected $searchCriteriaBuilder;
    protected $shipOrderInterface;

    public function __construct(
        Context $context,
        LoggerInterface $logger,
        OrderRepositoryInterface $orderRepository,
        SearchCriteriaBuilder $searchCriteriaBuilder,
        ShipOrderInterface $shipOrderInterface
    ) {
        $this->logger = $logger;
        $this->orderRepository = $orderRepository;
        $this->searchCriteriaBuilder = $searchCriteriaBuilder;
        $this->shipOrderInterface = $shipOrderInterface;

        parent::__construct($context);
    }

/**
   * Request quantity from Orchestra and update quantity in Source
   *
   * @return void
   */

    public function execute()
    {
        $searchCriteria = $this->searchCriteriaBuilder
            ->addFilter(
                'status',
                'processing',
                'eq'
            )
            ->create();

        $orders = $this->orderRepository->getList($searchCriteria);

        foreach ($orders->getItems() as $order) {
            try {
                $this->shipOrderInterface->execute(
                    $order->getEntityId(),
                    array(),
                    true,
                    false,
                    null,
                    array(
                        array(
                                "track_number" => "test-tracking",
                                "carrier_code" => "canadapost",
                                "title" => "Poste Canada"
                        )
                    ),
                    array(),
                    null
                );
            } catch (\Exception $e) {
                $this->logger->info($e->getMessage());
            }
        };
    }
}

I'm doing a little plugin who sync the database of a custom inventory system with magento.


texts: Update magento products programmatically without changing updated_at

texts:
I'm using to feed between my magento website and my ERP.
The first one is from ERP to and update the stock information of ALL PRODUCTS.

The second one is from magento to the ERP and update information like price, brand, ...
This one is based on the updated_at, we are sending only the products which has changed.

But, because of the first script, all products have changed.
Then i would like to keep the previous updated_at date in my first script.
I've tried this :

$product->setUpdatedAt($product->getUpdatedAt());

but it's not working.
Is there a way to do this ?

Thx


texts:
In magento2 Inline Edit date issues while i edit the record it display current date instead of my date

My Ui component

<!-- Date Column -->
        <column name="date" class="Magento\Ui\Component\Listing\Columns\Date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">dateRange</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
                    <item name="editor" xsi:type="string">date</item>
                    <item name="dataType" xsi:type="string">date</item>
                    <item name="label" xsi:type="string" translate="true">Date</item>
                    <item name="dateFormat" xsi:type="string" translate="true">MMM dd, YYYY</item>
                </item>
            </argument>
        </column>


texts: Magento 2 add downloable product programatically

texts:
I know how to add a simple product but cannot create a downloadable product programmatically. I am using following code for adding downloable product information:-

$product->setProductHasWeight(0); // weight of product
    $product->setIsDownloadable(1);

    $doanloadable_data = array(
                    'link' =>array('title' => 'first downloable product',
                       'price' => 9,
                       'number_of_downloads' => 10,
                       'is_shareable' => 1,
                       'type' => 'url',
                       'link_url' => 'http://w3solver.com',
                       'sample' => array('url'=>'http://w3solver.com',
                                        'type' => 'url'),
                       'is_unlimited' => 0,
                    ),
                    'sample' => array('title' => 'sample',
                        'sample_url' => 'http://w3solver.com',
                        'type' => 'url',
                        )
                    );
    $product->setDownloadable($doanloadable_data);

    $product->save();

Anyone here can please help me to find out what is the issue over here or what I can do make it work.


texts: Magento2 : Checkout items summary customization issue

texts:
In Magento 2 I try to customize checkout Items summary. I then created a module with :

Vendor/Module/Plugin/Checkout/Summary/ItemPlugin.php

namespace Vendor\Module\Plugin\Checkout\Summary;

use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Catalog\Model\Product;
use Magento\Quote\Model\Quote\Item;

class ItemPlugin
{
    protected $productRepo;

    public function __construct(
            ProductRepositoryInterface $productRepository
            )
    {
        $this->productRepo = $productRepository;
    }

    public function afterGetConfig(\Magento\Checkout\Model\DefaultConfigProvider $subject, array $result)
    {
        $TDitems = $result['totalsData']['items'];

        foreach ($TDitems as $key=>$item)
        {
            $result['totalsData']['items'][$key]['custinfo']='foo;
        }

        return $result;
    }
}

which adds custom parameters to items.

Vendor/Module/etc/di.xml
Vendor/Module/view/frontend/web/js/view/summary/item/details.js

define(
[
    'uiComponent'
],
function (Component) {
    "use strict";

    return Component.extend({
        defaults: {
            template: 'Vendor_Module/checkout/summary/item/details'
        },
        getValue: function(quoteItem) {
            return quoteItem.name;
        }
    });
}
);

Vendor/Module/view/frontend/web/template/checkout/summary/item/details.html

toto

...

Issues :

When I go from cart to checkout page, plugin is called, custinfo parapeter is added and displayed correctly.

When I go to next checkout step, the custom template is called (I can see the toto h1), but custinfo parameter is not displayed.
NB: I have a breakpoint on the plugin, and going from first checkout step to second checkout step does not call the plugin.

When I reload the second checkout step page, plugin is called, but parameter custinfo is still not displayed

When i go back from second step to first checkout page by clicking the "Shipping" step link, plugin is not called and custinfo param is not diplayed. I need to reload the page to make it appears.

Any idea of what is happening?

Thank you for your help,

EDIT1 :

I added in the details.html a Knockout command to log to console the $parent Object. On first checkout step I get :

Object { item_id: "92", name: "Blah", qty: 4, price: "18.0700", base_price: "18.0700", discount_percent: "0.0000", discount_amount: "0.0000", base_discount_amount: "0.0000", tax_percent: "0.0000", tax_amount: "0.0000", 14 more… }

On the second step I get :

Object { item_id: 92, price: 18.07, base_price: 18.07, qty: 4, row_total: 72.28, base_row_total: 72.28, row_total_with_discount: 0, tax_amount: 0, base_tax_amount: 0, tax_percent: 0, 11 more… }

clearly not the same object, but can not find where the second one is comming from (internal, session, cache, ...??)


texts:
Hello I'm facing the issue, when I change the input type text to number then it will allow the small and capital E latter rest of all letter will not able to type from keyboard but how can we prevent this error using js in magento2

please check the images below


texts: Add Checkbox like "Cash on Delivery" in billing method on checkout page

texts: How to create and allow cash on delivery checkbox on billing address step of checkout? If it's enabled then cash on delivery payment method should be visible on payment step.


texts: Magento 2 : Problem while adding custom button order view page?

texts:
di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Backend\Block\Widget\Context">
        <plugin name="add_custom_button_sales_veiw" type="MyModule\RK\Plugin\Widget\Context" sortOrder="1"/>
    </type>
</config>

Context.php

<?php
namespace MyModule\RK\Plugin\Widget;

class Context
{
    public function afterGetButtonList(
        \Magento\Backend\Block\Widget\Context $subject,
         $buttonList
    )
    {
        if($subject->getRequest()->getFullActionName() == 'sales_order_view'){
            $buttonList->add(
                'custom_button',
                [
                    'label' => 'test',
                    'onclick' => "setLocation('window.location.href')",
                    'class' => 'ship'
                ]
            );
        }

        return $buttonList;
    }
}

Review button is not displaying on order view page what i am doing wrong ??


texts: Magento 2 - How to use XML uiComponent instead of text/x-magento-init?

texts:
I found an easy hello world example from Max Pronko which uses text/x-magento-init to define a uiComponent.
MODULE/view/frontend/templates/script.phtml

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

        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" name="pronko.uicomponent"
                   template="Pronko_UiComponent::script.phtml" />
        </referenceContainer>

</page>

MODULE/view/frontend/web/js/component.js
define([
    'uiElement'
], function(Component) {
    'use strict';

    return Component.extend();
});

This shows "Hello world" in the frontend.

How can I rewrite this, to use XML uiComponent instead?
I tried it like this:
Company/Shipping/view/frontend/templates/test.phtml

Company/Shipping/view/frontend/web/js/test.js
define([
    'uiElement'
], function(Component) {
    'use strict';

    return Component.extend();
});

Company/Shipping/view/frontend/layout/default.xml
<?xml version="1.0"?>

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

        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" name="company.shipping.test" template="Company_Shipping::test.phtml">
                <arguments>
                    <argument name="jsLayout" xsi:type="array">
                        <item name="components" xsi:type="array">
                            <item name="foobar" xsi:type="array">
                                <item name="component" xsi:type="string">Company_Shipping/js/test</item>
                                <item name="title" xsi:type="string">Hello world!</item>
                            </item>
                        </item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>

</page>

But it does not write any data into the
 where it should put the title data "Hello world!" into it.
I've read the official documentation but the topic is a chaos with no practical examples.


texts:
Magento is redirecting to the wrong url.
Checked htaccess as I thought there is a problem but not, there is no redirect for this url. So I've checked rewrite table but there is no obvious cause.
For example, I have two products, different url's different SKU's
and the category list seems is pointing to the correct url but once I click on link it redirecting me to the other product with different url and SKU.
How to find where is the rewrite/redirect? Every url check says everything is fine but it does not say anything how or where this redirect is created/executed.
I'm confised

Also checked rewrites, just in case deleted every url directly related to the product I'm interrested in from the list and now it seems to work. But still, there was no obvious reason why it does it.
 Any ideas ?


texts: Magento 2 : Use HTTP i mistakenly set no

texts: In admin->stores->configuration->web->Default Cookie Settings->Use HTTP Only   i mistakenly set no after that in admin are blank how to solve this.


texts:
I am having error when i try to open my website.

Fatal error: Class 'Mage_Ultimo_Helper_Data' not found
in /home/archtraders/stationerypoint/app/Mage.php on line 547


texts: Magento2 : Change custom attribute scope not working

texts:
I create a product custom attribute programatically. The scope was WEBSITE. But now I just realised that this attribute must have the scope as STORE, because I need different values according to the store view.

I changed the scope in backend, clean the cache, and when I went to edit the product, the scope was correct [STORE]. Then I change store, view so I can insert the value for the store view and the scope changed to [WEBSITE].

I went back and the scope was wrong again [WEBSITE].

I went again to the attribute (Stores > Attributes > Product), choose my attribute, and the attribute had the right scope. I didn't change anything, only save the attribute again and clean the cache. Then I edit the product and the scope was correct [STORE], then I change store view and the scope was wrong again [WEBSITE].

I check database and the attribute is ok.

Did this happening to anyone?
Anyone has a clue about this?

Thank you


texts:
What i have done:

  Fresh install of Magento 2.1.3
  [Github] firegento-magesetup2; firegento/firegento-magesetup2
  [Github] german language files; splendidinternet/Magento2_German_LocalePack_de_DE

My question is:
When i change the logo under content - configuration - edit (single shop configuration) - header
nothing changes in the frontend.

Any suggestion for this issue?


texts: Problem for create dependency between Custom Fields and Customer Group Id field in customer form UI component

texts:
I created a new extension that add more fields to customer to control sales reps users. The fields and data are working as expected. But I want make the new fields be hide or disable for some customer groups.

I have two specifics customer groups for sales reps, so the new fields should be visible just for those customer which matchs in these groups inside admin customer form. So in other words, create a dependency between the new fields and the customer group select element.

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="customer">
        <field name="group_id" formElement="select">
            <settings>
                <switcherConfig>
                    <rules>
                        <rule name="0">
                            <value>5</value>
                            <actions>
                                <action name="0">
                                    <target>customer_form.customer_form.customer.brand_rep_manager</target>
                                    <callback>hide</callback>
                                </action>
                                <action name="1">
                                    <target>customer_form.customer.brand_of_rep</target>
                                    <callback>hide</callback>
                                </action>
                            </actions>
                        </rule>
                        <rule name="1">
                            <value>16</value>
                            <actions>
                                <action name="0">
                                    <target>customer_form.customer_form.customer.brand_rep_manager</target>
                                    <callback>show</callback>
                                </action>
                                <action name="1">
                                    <target>customer_form.customer_form.customer.brand_of_rep</target>
                                    <callback>show</callback>
                                </action>
                            </actions>
                        </rule>
                    </rules>
                    <enabled>true</enabled>
                </switcherConfig>
            </settings>
        </field>
        <field name="brand_rep_manager" sortOrder="970" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">0</item>
                </item>
            </argument>
        </field>
        <field name="brand_of_rep" sortOrder="975" formElement="select">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="string"></item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

Also I tried some variations and even added the <switcherConfig> inside the original customer_form.xml just to test it, but didn't work too.

And I already checked some previous question here and post like this one: https://www.hungersoft.com/info/dependent-fields-ui-component-form-magento2-without-js
I didn't see any reason for it not works as well.


texts:
For a special project we need to be able to subtract a variable amount from the cart totals. I couldn't really find an example which does that as well.

As far as I know, I know that cart discount is only available by applying a coupon code.

My idea would be to generate a temporary coupon code with the specified discount price, apply it to the cart and remove it after checkout.

Obviously this doesn't sound like the method to do this, but I can't really think of another method.

Does anyone have a better idea or could someone guide me into a certain direction?


texts: Remove Search By Keyword Box in admin grid

texts:
I have to remove this Search By Keyword box in customer grid. I overrided the customer_listing.xml but I dont know the syntax to disable it.
<filterSearch name="fulltext"/>

Do anyone have idea how to disable this


texts: What is the success rate to comply Magento 2 split database concept?

texts:
Currently, we are trying to do the Magento split database concept to split its catalog, checkout, and order master databases.

Magento documentation only speak about the very high level

https://devdocs.magento.com/guides/v2.3/config-guide/multi-master/multi-master.html
https://devdocs.magento.com/guides/v2.3/config-guide/multi-master/multi-master_manual.html

We know that our custom modules and extensions play more roles here. Do we have any technical process to verify whether our existing code will support the split database concept? Also, what is the success rate on this if anybody tried before?


texts: Magento 2 : File upload form front end in Custom Module

texts:
I am getting this error when I submit the form from the front end. Although I set the required extension in the setAllowedExtensions

  Exception #0 (InvalidArgumentException): Disallowed file type.

if($files!='')
    {
        foreach ($files as $key => $value) {

            $uploaderFactory = $this->uploaderFactory->create(['fileId' => $key]);
            $uploaderFactory->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png','pdf', 'docx', 'doc']);
            $imageAdapter = $this->adapterFactory->create();
            /* start of validated image */
            $uploaderFactory->addValidateCallback('custom_image_upload',
                $imageAdapter,'validateUploadFile');
            $uploaderFactory->setAllowRenameFiles(true);
            $uploaderFactory->setFilesDispersion(true);
            $mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
            $destinationPath = $mediaDirectory->getAbsolutePath('custom_module');
            $result = $uploaderFactory->save($destinationPath);

            $imagepath = $result['file'];
            //print_r($imagepath);exit;

            $saveData['custom_file'] = $imagepath;
            //$this->model->setData($saveData);

            //$submitModel->setData($saveData);
            //$submitModel->save();
        }
    }

  When I upload a jpeg or png it works fine ,but gives error on doc,docx and pdf


texts: Missing default store value of an attribute

texts:
I have a customer product attribute (id = 283) that stores data in catalog_product_entity_varchar

I noticed that sometimes when I load a product, or a collection, this attribute 283 and its value is missing in the product data.

I have identified it is because there is no value for the default store (0), it fails some SQL query, here an extract of the database:

value_id    entity_type_id  attribute_id    store_id    entity_id   value
30668852    4               283             2           1581        abc
20843831    4               283             0           45951       NULL
20843868    4               283             2           45951       def
21131745    4               283             3           45951       NULL
21138268    4               283             4           45951       NULL

For the product 45951, I have a value for each store, including the default one.
However for the product 1581, it is only defined for the store 2.

I realized that the products missing the NULL value for the default store were created before the creation of the custom attribute.

  Is there a proper way to fix catalog_product_entity_varchar (by creating the NULL values missing)?

I tried to reindex without success.

The way I load the products:

$products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('entity_id', array('in' => $ids));


texts: Increase index.max_result_window ElasticSearch 6+

texts:
I'm using Magento 2.3.4 Cloud Commerce with ElasticSearch 6+.

I want to increase max_result_window to 200000 instead of 100000 in following

http://localhost:9200/magento2_product_1_v2/_settings

I've tried to following in .magento.env.yaml

stage:
  deploy:
    ELASTICSUITE_CONFIGURATION:
      indices_settings:
        max_result_window: 500000

But not worked, Then I tried following in custom module di.xml

<type name="Magento\Search\Model\Search\PageSizeProvider">
    <arguments>
        <argument name="pageSizeBySearchEngine" xsi:type="array">
            <item name="elasticsearch6" xsi:type="number">200000</item>
        </argument>
    </arguments>
</type>

But that didn't work too.

Lastly I found that, This file Magento\MagentoCloud\Config\SearchEngine\ElasticSuite is creating ES Template while reindexing so is there anyways to override or is there any otherway by using which I can set the [index.max_result_window] to 200000?

Let me know if any more information is require.


texts: How to move advanced search into left of homepage and delete its own page

texts:
I am making a custom theme based on the rwd theme in magento 1.9 and would like to know how i can move the advanced search into the left of my homepage and delete its own page.

Thanks


texts: How can I send form data to database using magento 2

texts:
I created a menu in magento 2 admin panel, there is a form in it. below u can see that phtml file

Test Backend Module!

<form method="POST">
    Enter Your Name :
    <input type="text" name="message" id="input">
</form>

<input type="submit" onclick="showInput();">

Your Name :

If I click submit button i need to send those data to database and save in a table. how can i do that

My module directory like below

Company
    `-- AdminPage
        |
        |-- Controller
        |   |-- Adminhtml
        |       |-- HelloWorld
        |           `-- Index.php
        |-- etc
        |   |-- adminhtml
        |   |   |-- menu.xml
        |   |   `-- routes.xml
        |   `-- module.xml
        |-- view
        |   |-- adminhtml
        |       |-- layout
        |       |    `-- adminpage_helloworld_index.xml
        |       `-- templates
        |           `-- helloworld.phtml
        |-- composer.json
        `-- registration.php


texts:
please I am trying to add specific cities to which my shipping carrier destination and make them dropdown in my plugin.
This is my code so far but it's not working and I get Exception #0 (LogicException): ClicknShip\Module\Block\Checkoutmod\Checkoutmod does not implement BlockInterface.

this is checkout_index_index.html
<body>
    <referenceContainer name="content">
         <block class="ClicknShip\Module\Block\Checkoutmod\Checkoutmod" name="Checkoutmod_Checkoutmod" after="checkout.cart.coupon" template="ClicknShip_Module::checkout/cart/Checkoutmod.phtml">
        </block>
    </referenceContainer>

Lastly, I have checkoutmod.phtml

            getBlockHtml('formkey') ?>

                                test1
                                test2

    </form>
</div>

Here is my Checkoutmod class
getCities();
        $options = '';
        foreach($cities as $city){
            $isSelected = $selectedCity == $city ? ' selected="selected"' : null;
            $options .= '' . $city . '';
        }
        return $options;
    }
}

Please help


texts: Notice: Array to string conversion on admin category products save

texts:
I want to assign products from admin category module. But I am facing following using on category save.

Notice: Array to string conversion in /var/www/html/m202/vendor/magento/framework/Data/Form/Element/Image.php on line 51
#0 /var/www/html/m202/vendor/magento/framework/Data/Form/Element/Image.php(51): Magento\Framework\App\ErrorHandler->handler(8, 'Array to string...', '/var/www/html/b...', 51, Array)

Here is, what I am doing.

I am using Magento 2.0.2

Any help would be appreciated.


texts: Where is defined the Place Order button in default checkout payment step section?

texts:
I wanted to know where the button from the image is defined (The place order button in the payment step of checkout)

And also where is the discount code section defined?


texts:
I am trying to build an integration between my online inventory system and Magento.
However I am a bit lost in the terminology.

Do I need to build the plugin from my app, that will connect to the Magento account? Or will I need a plugin to Magento that will push data to my app?


texts: Change Magento admin panel menu position

texts: I want to change my custom module (named MODEL) menu position in Magento Admin panel. Right now it is added at last. I want something like this.


texts: How to import category position data in csv - Magento2

texts:
I try to add :1 :2 :3 or =1 =2 =3 after categories name
but both are not work
How can import the categories postiion data in csv?


texts: how to add product price based on two dropdown values in magento configurable product?

texts:
I am using magento 1.9. I would like to add a configurable product with price based on two dropdown values,

I have two attributes Thickness and Size.

Thickness dropdown with values 1/2 Inch and 1/4 Inch.

Size dropdown with values 8"x12" and 12"x16"

I would like to assign price like,

1/2 Inch X 8"x12" = 42$

1/2 Inch X 12"x16" = 62$

1/4 Inch X 8"x12" = 54$

1/4 Inch X 12"x16" = 82$

How can I achieve this ?


texts: data-post is not working after Ajax call

texts:
I've element like following in category page

    Compare

and it is working fine but when I apply the filter, By ajax new products are added to the page and for those newly added products on page data-post isn't working as expected


texts: Inserting Open Graph tags via custom module and block

texts:
I'm using Magento EE 1.6

When I use a custom block class to display some tags inside my <head>, block won't display. But if I use the "page/html" type, everything is fine... I need my custom class to add some features to the block (activation, getting image url etc).

Please help me to understand what I missed. Here is what I've done so far :

app/etc/modules/Wbx_Social.xml :

<?xml version="1.0"?>
<config>
    <modules>
        <Wbx_Social>
            <active>true</active>
            <codePool>local</codePool>
        </Wbx_Social>
    </modules>
</config>

app/code/local/Wbx/Social/etc/config.xml :

<?xml version="1.0"?>
<config>
    <modules>
        <Wbx_Social>
            <version>0.1.0</version>
        </Wbx_Social>
    </modules>
    <global>
        [...]
        <blocks>
            <wbx_social>
                <class>Wbx_Social_Block</class>
            </wbx_social>
        </blocks>
    </global>
    <frontend>
        <layout>
            <updates>
                <wbx_social>
                    <file>wbx_social.xml</file>
                </wbx_social>
            </updates>
        </layout>
    </frontend>
</config>

app/code/local/Wbx/Social/Block/Opengraph.php :

class Wbx_Social_Block_Opengraph extends Mage_Core_Block_Template
{
    /**
     * @return int
     */
    public function isActive()
    {
        return true; // Will be replaced with store config value
    }

    /* And other useful functions */

}

app/design/frontend/responsive/default/layout/wbx_social.xml :

<?xml version="1.0"?>
<layout>
    <default>
        <reference name="head">
            <block type="wbx_social/opengraph" name="opengraph" as="opengraph" template="social/opengraph.phtml"/>
        </reference>
    </default>
</layout>

And finally the template : app/design/frontend/responsive/default/template/social/opengraph.phtml :

<?php /* @var $this Wbx_Social_Block_Opengraph */ ?>
<?php if ($this->isActive()) : ?>
    <meta property="fb:app_id"       content="an id"/>
    <meta property="og:type"         content="website"/>
    <meta property="og:site_name"    content="a name"/>
<?php endif; ?>

Just in case, I didn't forget the Wbx_Social_Helper_Data empty helper.

In wbx_social.xml, when I try changing the block class for type="core/template" or type="page/html" (for example), the block is correctly displayed (without any access of custom functions of course)

I really need a hint, it's been several hours I'm tearing out...


texts: Magento 2 admin url gives error - Class Magento\Authorization\Model\RoleFactory does not exist

texts:
I have installed magento 2 on a local network (for example 192.200.200.200, and it is a virtual machine)

i was having some permission problems, had to run sudo php bin/magento setup:static-content:deploy

to create all css js required; public area looks fine but when i try to access mi admin url (192.200.200.200/admin_stuff) i get an error which is this: http://www.heypasteit.com/clip/2DKT

Could be a permission problem? right now all folder and file are own by root but folers var pub and app/etc are owned by the web user (www-data) with the right permissons

or maybe some file where not copied?


texts:
I have custom module storelocator.
Tabs used in the admin form. Below code is used to add tabs in the admin form.

$this->addTab('form_section_general', array(
          'label'     => Mage::helper('clarion_storelocator')->__('General'),
          'title'     => Mage::helper('clarion_storelocator')->__('General'),
          'content'   => $this->getLayout()->createBlock('clarion_storelocator/adminhtml_storelocator_edit_tab_form')->toHtml(),
      ));

      $this->addTab('form_section_google_map', array(
          'label'     => Mage::helper('clarion_storelocator')->__('Google Map'),
          'title'     => Mage::helper('clarion_storelocator')->__('Google Map'),
          'content'   => $this->getLayout()->createBlock('clarion_storelocator/adminhtml_storelocator_edit_tab_googlemap')->toHtml(),
      ));

General tabs shows correctly. But gives error for the tab 'Google Map'.  Error that i am getting is : Fatal error: Call to a member function toHtml() on a non-object.


texts: How to limit the number of products that can be added to cart from a particular category in magento 1.9?

texts:
I want to limit the number of products that can be added to the cart from a particular category.I want the customer to add only one product from each category. If the customer tries to add one more product ,the product added previously should get replaced by the one added later.
Can anyone help me with this?

This is my Observer.php code.


texts: Magento 2: Add Image to the Customer Account Navigation Menu

texts:
I hope everyone is doing well!

I am new to Magento 2. I would like to add Image for all the menus in "Customer Account Navigation Menu" at the top of each link. I am able to change the text of the Link but don't know how to add Image.
I request you all, please take a look at the highlighted part where I would like to add images for each link and properly guide me through this. Thank you in advance.
Stay Home Stay Safe!


texts: How to set the path in form.php for admin configuration to view the image

texts:
I am uploading images in my module using the folowing code at:

\Block\Adminhtml\Visualcolor\Edit\Tab\Form.php

$fieldset->addField('image', 'image', array(
  label' => Mage::helper('visualcolor')->__('Image'),
  'required' => false,
  'name' => 'image',
 ));

then I save it fine at the controller into my specific folder at media and works fine.

$path = Mage::getBaseDir('media') . DS . "visualcolors" . DS;
$uploader->save($path, $_FILES['image']['name']);

The problem it is how do i get the correct path in the form.php instead the default "media" folder?


texts: Is my current way to create a new Magento2 theme the correct method?

texts:
I have to create new theme that looks the default Magento Blank theme (other colors, other font). That's why I created a new theme with 1 file less css/source/_theme.less.

This file _theme.less looks like:

// first overwrite all variables
@font-family__base: "Times";
  // @etc.

    // mobile first
    body {
      background-color: green;
      font-family: @font-family__base;
    }

    // desktop
    @media only screen and (min-width: 768px) {
      body {
        background-color: red;
      }

    }

Technical it works, but it looks not nice :(

In addition, I often have to "!important" many rules, to overrule the Blank Theme, and I hate important-rules.

What is the most correct way to create a proper responsive theme (as tiny as possible)?


texts:
In admin I have the following controller:

<?php
namespace Vendor\Module\Controller\Adminhtml;

use Magento\Backend\App\Action\Context;

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

    /**
     * @param \Magento\Backend\App\Action\Context $context
     */
    public function __construct(
            Context $context,
            \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
    ) {
        parent::__construct($context);
        $this->resultJsonFactory = $resultJsonFactory;
    }

    public function execute()
    {
         return $this->resultJsonFactory->create()->setData([
            'this' => 'test'
        ]);
    }
}

in Vendor/Module/etc/adminhtml/routes.xml I have:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="module" frontName="module">
            <module name="Vendor_Module" />
        </route>
    </router>
</config>

In javascript I do the following ajax request to that controller:

jQuery.ajax( {
        url: location.protocol + '//' + location.host+'/admin/module/test',
        data: {form_key: window.FORM_KEY},
        type: 'POST'
    }).done(function(a) {
        console.log(a);
    });

And I receive 404 error

http://mydomain/admin/module/test?isAjax=true 404 (Forbidden)

as well.. same thing...

Why is this happening ?


texts:
I need to know once addto cart the product the success message shows ,but this is from template file not in controller,how to implement this in magento 2 .how the success reponse and sent when this message shows. When this success message trigger ,i need to extend the time to show this message.
can anyone explain me?


texts:
a strange thing happened to the website. Without any human intervention, a huge number of products (or maybe all of them) changed their id numbers. So now all the items open in different URL address. We discovered it, because lots of Crawl Errors started to appear in Google Webmaster.
For example let's take this ULR which appears to be not found.

http://www.jewelsberry.com/angelfish-charm-pendant-14k-gold-23854.html

If we search it in Google we can open a cached versión of the page. So this product is DZ-631. Angelfish Charm Pendant 14k Gold.
Then searching DZ-631 in catalog we find out that this ítem is existing, but somehow has different id, so it opens in different address now:

http://www.jewelsberry.com/angelfish-charm-pendant-14k-gold-23521.html

Magento version is 1.7.0.0

Please help to understand how it could happen and what can I do to fix it


texts: magento 2 disable custom cron job from module

texts: I have created a Custom cron job for product price updation using csv. I want to disable cron job if Module is disabled from admin. How it will be done?


texts: Adding data to database from custom form

texts:
I'm able to fetch data from custom form but not able to put it in database table. Here I post details of model and controller

SimpleMagento\Custom\Model\Name.php

class Name extends \Magento\Framework\Model\AbstractModel {
public function _construct()
{
    $this->_init('SimpleMagento\Custom\Model\ResourceModel\Name');
}

SimpleMagento\Custom\Model\ResourceModel\Name.php

 class Nameextends\Magento\Framework\Model\ResourceModel\Db\AbstractDb
  {
    public function _construct()
     {
         $this->_init("new_info","entity_id");
      }
   }

SimpleMagento\Custom\Model\ResourceModel\Name\Collection.php

  class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
  {
      public function _construct()
      {
       $this->_init("SimpleMagento\Custom\Model\Name","SimpleMagento\Custom\Model\ResourceModel\Name");
      }
  }

Controller\Test.php

$model = $this->_name->create();
$entity = $this->getRequest()->getParams();
$model->addData([
    "entity_id" => $entity['entity_id'],
    "customer_id" => $entity['customer_id'],
    "position" => $entity['position'],
    "department" => $entity['department']
]);

$saveData = $model->save();

if($saveData)
{
    $this->messageManager->addSuccess('Record Inserted...!');
}
else
{
    $this->messageManager->addSuccess('Record Inserted...!');
 }

Table Structure -

class InstallSchema implements InstallSchemaInterface
 {
     public function install(SchemaSetupInterface $setup,
     ModuleContextInterface $context)
     {
       $setup->startSetup();

        $name = $setup->getTable('new_info');
    // Create your table now
    $table = $setup->getConnection()->newTable($name
    )->addColumn(
        'entity_id',
        Table::TYPE_INTEGER,
        null,
        [
            'identity' => true,
            'nullable' => false,
            'primary' => true
        ],
        'ID'
    )->addColumn(
        'customer_id',
        Table::TYPE_INTEGER,
        255,
        [
            'nullable' => false
        ],
        'Customer ID'
    )->addColumn(
        'position',
        Table::TYPE_TEXT,
        255,
        [
            'nullable' => false,
            'default' => ''
        ],
        'Position of employee'
    )->addColumn(
        'department',
        Table::TYPE_TEXT,
        255,
        [
            'nullable' => false,
            'default' => ''
        ],
        'Department of employee'
)->setComment("Custom_table");
$setup->getConnection()->createTable($table);
$setup->endSetup();

}


texts:
I try to export my products in Magento 2.1.8. When i select to export products and csv files format and i press continue then showing 'Please correct the data sent value.'

Log file error:

  [2018-11-26 07:44:21] main.CRITICAL: Exception: Notice: A non well
  formed numeric value encountered in
  /var/www/html/vendor/magento/module-catalog-import-export/Model/Export/Product.php
  on line 773 in
  /var/www/html/vendor/magento/framework/App/ErrorHandler.php:61 Stack
  trace:

Does anyone know what caused this issue?


texts: I would like to discount only when 5 or more qualifying lines exist

texts:
I need to set up a discount system where when the customer is buying 5 or more kinds of things from a category they get a discount on everything from that category.
It doesnt mater how many of each thing they buy, and if they only get 4 product lines they dont get the discount even if they are buying hundreds of them. (they would get pricebreaks instead)

How can I build or program this into magento 2.3.4?


texts: Magento 2 Uncaught TypeError: Cannot read property 'quoteData' of undefined

texts:
/checkout/ page (for “one page checkout” mode)
“Cannot read property "quoteData” of undefined" from quote.js
The error is coming from OOB quote.js, so tried creating a custom version by adding 'domReady!' and still not working.

I tried different ways but the error came up again after few days in our testing/lower environment but same code works fine in production site. We saw this error few days ago but went away after clearing cache but showed up again.

Tried adding 'domReady!' as suggested at Github post and mage2pro topic but still no luck. Clear cache, upgraded as well bunch of times. Magento CE version 2.2.6.

Getting this error when going to next page from shopping cart(checkout/).

Uncaught TypeError: Cannot read property 'quoteData' of undefined
    at quote.js:33
    at Object.execCb (require.js:1650)
    at Object.context.execCb (resolver.js:145)
    at Module.check (require.js:866)
    at Module.enable (require.js:1143)
    at Module.init (require.js:774)
    at callGetModule (require.js:1170)
    at Object.completeLoad (require.js:1544)
    at HTMLScriptElement.onScriptLoad (require.js:1671)


texts:
I have observer targeted on "catalog_product_save_after" event.

Need to check if current product is completelly new and not one of existing items.

How to do this?


texts: Remove keywords meta tag from head in Magento 2

texts: It seems like having a keywords meta tag in your head is nowadays bad for SEO. Does anyone know how to remove the keywords meta tag from the head in Magento 2 in a professional way?


texts: How to setup multi stores with different themes for Magento CE

texts:
I'm new to Magento. Our plan of creating eCommerce website with Magento CE is like that: we only have one website (one domain), first, we will create one store, name 'handbag', the landing page will be all about handbags. In the near future, we will introduce electornical products and create the second store, name 'electronic'. When we introduce the second store, the landing page will be replaced with a new landing page which has icons to guide customers to select 'handbag' or 'electronic'. And the two stores will have its own theme. My questions are:
1. I know it is easy to create multiple stores, but no idea with how to create different themes for these two stores.
2. How to introduce a new landing page in Magento CE, with which, the users can select 'handbag' or 'electronic' stores, then the total different store theme will show up.

Thanks,
Collin


texts: Magento 2 - custom attribute for Shipping method / Carrier

texts:
I would like to add custom attribute for shipping method so that I can set it up in admin panel:

I know it should be done in Setup\InstallSchema.php, but what entity name shall I use instead of Product::Entity?

// Add our "features" attribute
    $eavSetup->addAttribute(Product::ENTITY, 'features', [
        'type' => 'text',
        'label' => 'Features',
        'input' => 'textarea',
        'required' => false,
        'sort_order' => 100,
        'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
        'wysiwyg_enabled' => true,
        'is_html_allowed_on_front' => true,
    ]);


texts: How can I create a preview box for my text input, taking into account font and colour

texts:
I need to create a preview box for my text. A good example can be found on the website below. It takes the user input and generates a PNG of what it would look like.

How would I be able to do something similar?


texts: How to translate validation messages in magento2

texts: I am not able to change the language of "*Require" in magento2


texts: How do I change the Template Layout for the Customer 'My Account' page?

texts:
This might be very basic...

I need to change the Template Layout for the "My Account" page

It is currently using:
frontend/mypackage/mytheme/template/page/2columns-left.phtml

And I need to change it to:
frontend/mypackage/mytheme/template/page/1column.phtml

I can't see any way to change it... I don't even know which file the template is defined. It might be using the 'default' setting - but I don't know where that is populated. Please help :)


texts: Magento 2: How to add title tag in product image in product details page?

texts:
How to add title tag in product image in product details page?

current img tag in product detail page

I want to add title tag like:

Please let me know any suggestion to do this.


texts:
I am adding 2 custom attribute when product is virtual.

But when i checking my downloadable product all other attributes are not display excepting images and videos.

Can anyone help?

Getting below error in console:

  Uncaught ReferenceError: Unable to process binding "if: function(){return label }"
  Message: label is not defined
      at if (eval at createBindingsStringEvaluator (knockout.js:2624), :3:55)
      at ko.computed.disposeWhenNodeIsRemoved (knockout.js:3989)
      at evaluateImmediate (knockout.js:1737)
      at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
      at init (knockout.js:3988)
      at knockout.js:2989
      at Object.ignore (knockout.js:1249)
      at knockout.js:2988
      at Object.arrayForEach (knockout.js:151)
      at applyBindingsToNodeInternal (knockout.js:2974)


texts:
What are the steps that need to be taken to achieve PCI Compliance for Magento CE?

For example using Paypal website payments pro or sage pay direct in a store would help to achieve PCI compliance?


texts: How to override wishlist price in magento 2?

texts:
I am developing a custom module for price calculation and i was able to change the price in final_price.phtml to change prices and changed grid.phtml to override category page listing items.

it looks like the price has been updated to all the pages except wishlist.

how to make the price changes in wishlist too?


texts: Magento 2 - How to create a Landing Page

texts:
I am still so new to Magento and still learning.
I want to create a landing page for a brand promo or a certain product advertisement. Something like this https://advertising.amazon.com/resources/ad-specs/landing-pages
How can I do that through code changes and be customizable in the admin panel?
Thanks.


texts: How to change Customer Login Title in magento 2?

texts: I am trying to change the title of the customer login page. so i have override custom login block file for PrepareLayout method but its not work any one have idea for this??


texts: Magento2 - Getting wrong From email Address in Back in Stock email

texts:
I have a multi-store setup, I am facing issue when Product back in stock emails are getting fired. I am getting emails of Back in stock but the 'Form' email Address is taken from default store & not a specific store.

I am fetching email address from 'Sales Representative' in Admin under Store Email Address.


texts: Magento 2 CMS Block: Is it possible to use another directive within translate directive?

texts:
For example I have a CMS block with a text I want to translate but I have a link inside this text that uses the {{store url=""}} directive.

In my cms block:

{{trans "Foo bar"}}

In my translation:

"Foo bar","My translation"

It results in: Foo bar"}}

Is it just not possible or do I have any other mistake?


texts: How to change div fotorama__stage height on product view page

texts:
How can I change height in the below code on Product detail page

<div class="fotorama__stage" data-fotorama-stage="fotorama__stage" style="width: 462px; height: 372px;">

I have tried below code in app/design/frontend/Custom/mytheme/etc/view.xml

<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <media>
        <images module="Magento_Catalog">
            <image id="category_page_grid" type="small_image">
                <width>280</width>
                <height>400</height>
            </image>
            <image id="product_page_image_large" type="image"/>
            <image id="product_page_image_medium" type="image">
                <width>870</width>
                <height>700</height>
            </image>
            <image id="product_page_main_image" type="image">
                <width>870</width>
                <height>700</height>
            </image>
            <image id="product_page_main_image_default" type="image">
                <width>870</width>
                <height>700</height>
            </image>
        </images>
    </media>
</view>

It is only changing the image size and not the div size.


texts: Magento 1.9 - Free shipping not working with cart price rule

texts:
I have set up a cart price rule which provides free shipping if a product is found from the mentioned category but it is not working properly, coupon code is getting applied on the front-end but it is not reflecting shipping price on checkout.

What I am doing wrong here?


texts: How to display bundle product items name in My cart page?

texts: I want to display bundle product item name in  My cart page in 1.9.2.4 .Suggest me some solution


texts:
I started with the RWD theme to create a resonsive site with our current style.
Except one thing in which I'm running to is the background image...

Before the RWD theme our site had just a static width so it was very easy to put in a background image. But now with the RWD theme the width is completely flexible.

I have already played around a bit with sizes, but I just can't work out how it will looks nice. I want the main part of the shop to have a white background with borders left and right of the site. It would be best if the background is static so it won't scroll down with the user once he starts scrolling.

I really like the idea of the SCSS setup together with compass but I just can't find where to put in the files that the main part of the shop needs to have a white background.

My idea was to put in /content/_home.scss in the body.cms_home tag the background: #FFFFFF tag, but that just won't work.
There are just too many files who all declare some sort of background colour ;)

To get an idea:
My current (just starting) project is located at http://staging.afvallenmetbregje.nl and the current (old) layout of our site is at http://www.afvallenmetbregje.nl

I would really appreciate some input from the more advanced graphic developers on placement / creation of our background....


texts:
images/logo.png

          navigation-sections
          nav-sections

                links

          Privacy Policy
          privacy-policy-cookie-restriction-mode


texts: I'm looking for an integration solution between Magento CE and Sage 50 Quantum Canadian Edition. I see there are solutions for the US version of Sage but cannot seem to find any affordable solutions for the Canadian edition. Has anyone worked with integrating Magento with Sage 50 Canadian Edition before and have any suggestions?


texts: Create admin user in magento 2 using commmand line

texts:
create admin user using command line...

php bin/magento admin:user:create --admin-user='username' --admin-password='password' --admin-email='admin@admin.com' --admin-firstname='Admin' --admin-lastname='Admin'


texts: Magento 2 How to filter shared wishlist items function?

texts:
I want to add a new filter in shared wishlist items.
I have used the preference method to override the block method. The problem is that the addFieldToFilter is not working. How can I achieve it?

Here is my di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Wishlist\Block\Share\Email\Items" type="Company\Module\Block\Share\Email\Items"/>
</config>

Company\Module\Block\Share\Email\Items.php

namespace Company\Module\Block\Share\Email;

class Items extends \Magento\Wishlist\Block\Share\Email\Items
{

    protected $_template = 'email/items.phtml';

    public function getWishlistItems()
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/jancy.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('entry');

        if ($this->_collection === null) {
            $this->_collection = $this->_createWishlistItemCollection();
            $this->_prepareCollection($this->_collection);
         }
         $this->_collection->addFieldToFilter('custom_id', '4');
        return $this->_collection;
    }

}


texts: How to get filter options on category page using REST APIs Magento 2

texts:
I need to get all applicable filters on a category page. I am using below API to fetch all filters.

http://localhost/magento/rest/default/V1/products/attributes?searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][field]=is_filterable

It will give all filterable attributes of product. How can I pass category reference in this API so that it will return only filterable attribute which applicable for that category only.


texts: Paypal geteway Internal Error (#10001: Internal Error)

texts:
This is Debug log dump.
But I have no idea what's going on.

Test in paypal sandbox mode.
Check out with Paypal express.

2014-05-01T06:30:17+00:00 DEBUG (7): Array
(
    [url] => https://api-3t.sandbox.paypal.com/nvp
    [ManagePendingTransactionStatus] => Array
        (
            [TRANSACTIONID] => 4GB13868J7284553K
            [ACTION] => Accept
            [METHOD] => ManagePendingTransactionStatus
            [VERSION] => 72.0
            [USER] => ****
            [PWD] => ****
            [SIGNATURE] => ****
            [BUTTONSOURCE] => Varien_Cart_EC
        )

    [response] => Array
        (
            [TRANSACTIONID] => 4GB13868J7284553K
            [STATUS] => The Status of the transaction after running the your action (accept/deny) is:Unable To Determine
            [TIMESTAMP] => 2014-05-01T06:30:11Z
            [CORRELATIONID] => c38b1544405a1
            [ACK] => Failure
            [VERSION] => 72.0
            [BUILD] => 10800277
            [L_ERRORCODE0] => 10001
            [L_SHORTMESSAGE0] => Internal Error
            [L_LONGMESSAGE0] => Internal Error
            [L_SEVERITYCODE0] => Error
        )

    [__pid] => 553023
)

exception.log

2014-04-30T06:08:43+00:00 ERR (3):
    exception 'Mage_Core_Exception' with message 'PayPal NVP gateway errors: Internal Error (#10001: Internal Error). Correlation ID: e472a9b1d2146. Version: 72.0.' in /home/sokietec/public_html/app/Mage.php:580
    Stack trace:
    #0 /home/sokietec/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(1050): Mage::exception('Mage_Core', 'PayPal NVP gate...')
    #1 /home/sokietec/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(1011): Mage_Paypal_Model_Api_Nvp->_handleCallErrors(Array)
    #2 /home/sokietec/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(773): Mage_Paypal_Model_Api_Nvp->call('ManagePendingTr...', Array)
    #3 /home/sokietec/public_html/app/code/core/Mage/Paypal/Model/Pro.php(311): Mage_Paypal_Model_Api_Nvp->callManagePendingTransactionStatus()
    #4 /home/sokietec/public_html/app/code/core/Mage/Paypal/Model/Express.php(406): Mage_Paypal_Model_Pro->reviewPayment(Object(Mage_Sales_Model_Order_Payment), 'accept')
    #5 /home/sokietec/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(932): Mage_Paypal_Model_Express->acceptPayment(Object(Mage_Sales_Model_Order_Payment))
    #6 /home/sokietec/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(896): Mage_Sales_Model_Order_Payment->registerPaymentReviewAction('accept', true)
    #7 /home/sokietec/public_html/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(240): Mage_Sales_Model_Order_Payment->accept()
    #8 /home/sokietec/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_OrderController->reviewPaymentAction()
    #9 /home/sokietec/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reviewPayment')
    #10 /home/sokietec/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
    #11 /home/sokietec/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
    #12 /home/sokietec/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
    #13 /home/sokietec/public_html/index.php(87): Mage::run('', 'store')
    #14 {main}


texts: magento 2 create shipment programmatically with inventory source selection

texts:
I have created order shipment programmatically with below code but I don't know how to select SourceCode when multiple sources available in Magento backend.

public function execute()
    {
        $orderId = $this->getRequest()->getParam('order_id');
        $order = $this->_objectManager->create('Magento\Sales\Model\Order')->load($orderId);

        // Check if order can be shipped or has already shipped
        if (!$order->canShip()) {
            throw new \Magento\Framework\Exception\LocalizedException(
                __('You can\'t create an shipment.')
            );
        }

        // Initialize the order shipment object
        $convertOrder = $this->_objectManager->create('Magento\Sales\Model\Convert\Order');
        $shipment = $convertOrder->toShipment($order);

        // Loop through order items
        foreach ($order->getAllItems() AS $orderItem) {
            // Check if order item has qty to ship or is virtual
            if (! $orderItem->getQtyToShip() || $orderItem->getIsVirtual()) {
                continue;
            }

            $qtyShipped = $orderItem->getQtyToShip();

            // Create shipment item with qty
            $shipmentItem = $convertOrder->itemToShipmentItem($orderItem)->setQty($qtyShipped);

            // Add shipment item to shipment
            $shipment->addItem($shipmentItem);
        }

        // Register shipment
        $shipment->register();

        $shipment->getOrder()->setIsInProcess(true);

        try {
            // Save created shipment and order
            $shipment->getExtensionAttributes()->setSourceCode('default');
            $shipment->save();

            $order = $this->_objectManager->create('Magento\Sales\Model\Order')->load($orderId);
            $order->setState('processing')
                ->setStatus('processing')
                ->save();

            // Send email
            //$this->_objectManager->create('Magento\Shipping\Model\ShipmentNotifier')->notify($shipment);
            //$shipment->save();

            $this->messageManager->addSuccess(__('Shipment has been created successfully.'));

            $pathParams = ['order_id' => $orderId];
            $path = 'sales/order/view';

            return $this->resultRedirectFactory->create()->setPath($path, $pathParams);
        } catch (\Exception $e) {
            throw new \Magento\Framework\Exception\LocalizedException(
                __($e->getMessage())
            );
        }
    }

Here, I have put static code to select Source Code $shipment->getExtensionAttributes()->setSourceCode('default');  and its working fine.

I want to make it dynamic as per order.

How to get source code from order?


texts:
How can I set a default tax rate that is not attached to a country?

We do not collect any address details within Magento, but we need to apply tax.

Is there a way to apply tax without relating it to a country?


texts: checkout cart page add cms static block in magento 2.4.0

texts:
Now i am trying add cms static block in checkout_cart_index.xml file add but not added block in checkout cart page

checkout_cart_index.xml

<?xml version="1.0"?>

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="content">
        <block class="Magento\Checkout\Block\Cart" name="banners-checkout">
            <arguments>
                <argument name="10" xsi:type="string">banners-checkout</argument>
            </arguments>
        </block>
    </referenceContainer>
</body>


texts: I have problem with pagination in admin grid in manage products and  orders. After log to admin, when I go to manage products grid show me all products in list (default set 20). When I set value for example to 30, pagination work. When I set 20 pagination work also. Pagination not work only directly after log to admin. Do you have any hints? I didn't find nothing in controller in gridAction...


texts: Dynamic attribute filters (on Amasty Improved Navigation)

texts:
We use to have a filter on our previous magento installation which shows the

New Arrivals
New on Sale products
Back in Stock products

But our developer left the team and hasn't told us how he has coded that.

When I check the attributes from the admin panel, there are attributes called prod_options, backinstockdate, pricechangedate.

prod_options is filterable and it has New Arrivals, New on Sale, Back in Stock as option values. But the prod_options field is empty on all products. I thought this should be a dynamic attribute.

The template hints show
Amasty_Shopby_Block_Catalog_Layer_Filter_Attribute / frontend/base/default/template/amasty/amshopby/attribute.phtml
But this doesn't give me any clue! How can I find the code behind this filter?

Our new site works on Magento 1.9.2.4. We also use Amasty Improved Navigation extension.

Thx


texts: What is the event fires when customer logged in and initialize the cart?

texts:
What event is fire when initialize the shopping cart just after the customer logged in? This event should set the remained cart items as well as the grand total and subtotal for that cart.

Can anyone suggest the event please?

Thanks in advanced.


texts: Magento 1.9 product import - timeout 240 seconds occurs - WHY? please help

texts:
I got a cron job which creates products. There are many products, so the cron runs more than every 4 hours.

I create my products in batches of 250 and with paging. If I create every batch/page single wise, there is no error.

If I run the cron job as it should be (all product batches in row), then I get a timeout.

[27-Sep-2018 13:09:26 UTC] PHP Fatal error:  Maximum execution time of 240 seconds exceeded in /../magento/app/Mage.php on line 0
[01-Oct-2018 08:41:03 UTC] PHP Fatal error:  Maximum execution time of 240 seconds exceeded in /../magento/lib/Zend/Cache/Backend/File.php on line 730
[01-Oct-2018 08:52:15 UTC] PHP Fatal error:  Maximum execution time of 240 seconds exceeded in /../magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 574

the file and line, where this error comes from, varies from time to time...

on top of my importer file I call this, because I hoped it would help...

ini_set('MAX_EXECUTION_TIME', -1);

php_ini max_execution_time is set to 18000... where does this 240 come from and how can I change it?


texts: Create coupon that sets the shipping rate to a specific amount

texts:
I need to create a coupon that sets the shipping rate of an item to a specific amount.

For instance, if the customer purchases any item and uses this specific coupon code (cart rule), their shipping amount is always set to $5, no matter what.

So if a customer buys a $3 item and their shipping is $10, this will always lower their shipping to $5, giving a total of $8.


texts: Magento 2 how to create Single Time Picker

texts:
I know magento provides functionality like Single Time Picker:

How to do it? I found how to create date picker and date-time picker. But for my task, i should to create single time picker...


texts:
I have the folder path /var/www/html/stagedesign/magento_root

How do I set folder permisson 777 to only stagedesign?

I have tried this in the stagedesign folder but nothing happened.

find . -type f -exec chmod 644 {} \;

find . -type d -exec chmod 755 {} \;

find ./var -type d -exec chmod 777 {} \;

find ./pub/media -type d -exec chmod 777 {} \;

find ./pub/static -type d -exec chmod 777 {} \;

chmod 777 ./app/etc

chmod 644 ./app/etc/*.xml

I was looking at a few other examples but I couldn't find an answer to set the permissions to one folder.

I have been looking at these:

Magento 2 folder/file permissions
https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html
https://community.magento.com/t5/Magento-2-x-Hosting-Performance/Folder-Permissions-for-magento2/td-p/110546
https://amasty.com/knowledge-base/magento-2-permissions-and-ownership.html


texts: Magento add to cart programatically based on custom price

texts:
I try to add product in cart programmatically. I am using KG Based if 0.5=>100rs and 1=>150rs like wise it will increment based on kg.

controller.php

public function addtocartAction(){
  //* Get Product id From Form Post */
    $product_id =  1;
    $price =  10;
    $qty = 0.5;

  /* Get Product id From Form Post */
        $product= Mage::getModel('catalog/product');
        $product->load($product_id); // Product Id
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        $quote->addProduct($product,$price);

        $cart = Mage::getSingleton('checkout/cart');
        $cart->init();
        $cart->save();
        Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
        $quote->collectTotals()->save();

      /* Add Product in to Cart */
    $this->_redirect('checkout/cart');
      Mage::getSingleton('core/session')->addSuccess('Your products has been Added Successfully');

}

It's not working how to achieve this? any suggestion please?


texts:
I'm trying to compile etc. after recently upgrading to Magento 2.3.1.

I use this command:

$ php -dmemory_limit=-1 bin/magento setup:di:compile

which returns this error:

  Source class "\Magento\Elasticsearch6\Model\Adapter\FieldMapper\ProductField" for "Magento\Elasticsearch6\Model\Adapter\FieldMapper\ProductFieldMapper" generation does not exist.

But I don't get why it's not being generated, here are my file permissions:

drwxrwxr-x 15 dev-admin devs          4096 Apr 10 16:22 ./
drwxrwxr-x  6 dev-admin devs            65 Apr 10 16:08 ../
drwxrwxr-x  5 dev-admin devs           122 Apr 10 16:22 app/
-rwxr-xr-x  1 dev-admin dev-admin      234 Apr 10 16:22 auth.json.sample*
drwxrwxr-x  2 dev-admin devs            38 Apr 10 16:22 bin/
-rwxr-xr-x  1 dev-admin dev-admin   434981 Apr 10 16:22 CHANGELOG.md*
-rwxr-xr-x  1 dev-admin dev-admin     2152 Apr 10 16:15 composer.json*
-rwxr-xr-x  1 dev-admin devs        636665 Apr 10 16:22 composer.lock*
-rwxr-xr-x  1 dev-admin dev-admin      650 Apr 10 16:22 COPYING.txt*
drwxrwxr-x  5 dev-admin devs            63 Apr 10 16:22 dev/
drwxrwxrwx  3 dev-admin dev-admin       35 Apr 10 16:47 generated/
drwxrwxr-x  3 dev-admin dev-admin      151 Apr 10 16:22 .github/
-rwxr-xr-x  1 dev-admin devs          1437 Jun 25  2018 .gitignore*
-rwxr-xr-x  1 dev-admin dev-admin    12076 Apr 10 16:22 .htaccess*
-rwxr-xr-x  1 dev-admin dev-admin     1370 Apr 10 16:22 index.php*
drwxrwxr-x  4 dev-admin devs            50 Apr 10 16:22 lib/
-rwxr-xr-x  1 dev-admin dev-admin    10376 Apr 10 16:22 LICENSE_AFL.txt*
-rwxr-xr-x  1 dev-admin dev-admin    10364 Apr 10 16:22 LICENSE.txt*
-rwxr-xr-x  1 dev-admin dev-admin     1654 Apr 10 16:22 .php_cs.dist*
drwxrwxr-x  2 dev-admin dev-admin       58 Apr 10 16:22 phpserver/
drwxrwxrwx  6 dev-admin devs           201 Apr 10 16:22 pub/
drwxrwxr-x  7 dev-admin dev-admin      115 Apr 10 16:22 setup/
-rwxr-xr-x  1 dev-admin dev-admin     2095 Apr 10 16:22 .travis.yml*
drwxrwxr-x  7 dev-admin dev-admin      191 Apr 10 16:03 update/
-rwxr-xr-x  1 dev-admin dev-admin      101 Apr 10 16:22 .user.ini*
drwxrwxrwx 10 dev-admin devs         237 Apr 10 16:47 var/
drwxrwxr-x 62 dev-admin devs          4096 Apr 10 16:22 vendor/

so generated/ has full permissions... how do I go about debugging this and actually getting this to generate so I can actually finish my upgrade?


texts: What is solution for this after the disabling the extension my site is not loading css and js in frontend and admin area of magento

texts:
I disabled an extension and now the CSS and JS is not loading anymore.

The extension documentation states:

  Don't try to disable the output of Fooman_Speedster under Configuration > Advanced - it will make your site unusable!

What can I do to recover?


texts: Magento 2.0.9 stock does not decrease with order / stock levels do not update

texts:
We have recently installed Magento 2 on AWS, after using Magento 1 on another server. We did a fresh install with a new store. Magento is up to date at 2.0.9. Everything is running, except when an order is placed, stock does not decrease.
Configuration > Catalog > Inventory > Decrease Stock When Order is Placed is set to Yes.

I have searched extensively on this issue and have found nothing. Any help would be greatly appreciated - we are close to launch and have only just noticed this issue. Thank you very much.


texts: Events, is there a predefined list of events or not

texts: I want to know if there is a predefined list of events like this one https://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/ or not because most of the events are dynamically named ?


texts: I made a special store front for a mobile version of my site. How to redirect mobile devices there and also link back to the desktop site?

texts:
I've setup a special mobile store/store front under a subdomain - www.m.mydomain.com according to this tutorial.

I was going to put this code in the Miscellaneous scripts to make the system detect that a customer is connecting from a mobile device and forward the traffic to www.m.mydomain.com:

I have a special responsive mobile store at m.MYdomain.com - how to make Magento detect mobile devices and forward the traffic to m.Mydomain.com?

But now I'm thinking a better solution might just be through changing the .htaccess file as explained here.

But I don't understand where to put that code into? Also - that post is from 2010. Is there something newer to go with given the development in the mobile devices and tablets?

I also need to place a large button on the mobile site (at www.m.mydomain.com ) that would re-direct customers to the desktop version of the site (www.mydomain.com) if they choose to. What is the best way to do that?

I mean - How can this work? Will it not be stuck in a loop? When the customer clicks the button that will send it to www.mydomain.com, won't the script once again detect that it is a mobile device and transfer the traffic back to www.m.mydomain.com ? I read about doing it with cookies but how exactly? And how would I set that button up?

I am looking for a simple solution as in: take this code and put it here. Change this code here and you are done! :o)

In my example my desktop site is: www.mydomain.com and my mobile is at: www.m.mydomain.com while my desktop store name and store front name is: mydomain.com and my mobile store name and store front name is: mmydomaincom

Updated December 12th:

Please don't tell me to load a different theme. I already have a nice responsive theme! This is not the problem. The reason I want to redirect to my mobile site (located at www.m.mysite.com) is that I have around 50 products on my desktop front page and a lot of things (such as text put on there by the SEO company) that are just taking up space and I don't need to display that clutter on mobile devices. I think that ordering on a mobile device should be fast and easy without unnecessary junk. That said - I am not trying to reinvent the wheel here. I need 2 things.

1. Detect the mobile device and if that is so - load www.m.mysite.com instead of www.mysite.com

2. Add a button for people who for whatever reason (maybe they are connected to a fast wifi connection) decide they want the desktop version instead and make it work when they click it to display www.mysite.com

If you go to www.ebay.com on your mobile phone - it redirects to "m.ebay.com" Same with YouTube, Facebook, Twitter, LinkedIn...So don't tell me this is an old age approach. If these multi-billion dollar companies are doing it - it has some logic behind it....


texts: How can i increased selected items default QTY count in products page

texts:
I need to set up selected products default count is what i suggest. How can i set my default minimum count.

I need to set defauly Qty = 5 for elected products


texts:
I want to give 20% discount for each order up to Rs. 500, so that maximum discount amount will be Rs. 500 means no one will get more than Rs. 500 discount.

I want to create coupon code for this.

How should I achieve that?

Please help me.


texts: Varnish Cache-Control: Max_Age 0 ; On Magento 2

texts:
So I have installed xVarnish or, CacheWall, but the Cache-control max_age is set to 0. I found this post here but I am not sure of the exact location that I can implement the answers suggestion of

"You are just missing session_cache_limiter and session_cache_expire, which should be the first lines executed on the requested PHP script, even before session_start()."

The same person edited their answer to also give the added option of modifying Apache mod_expires which I tried to do with this tutorial here which  threw an error of wrong syntax when I tried to restart my apache2 server.

Is there a tutorial some one could point me too? or some direction on modifying the session_start in magento?

Sorry if this has been asked before and for my noobness. The url I am trying this on is www.brotomic.com the headers contain

 [root@host ~]# curl -I http://www.brotomic.com
HTTP/1.1 302 Found
Date: Thu, 17 Aug 2017 18:14:15 GMT
Pragma: no-cache
Cache-Control: max-age=0, must-revalidate, no-cache, no-store
Expires: Wed, 17 Aug 2016 18:14:15 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: PHPSESSID=o3h5m3r4ei5o3628ij49940u62; expires=Thu, 17-Aug-2017 19:14:15 GMT; Max-Age=3600; path=/; domain=www.brotomic.com; HttpOnly
Location: http://brotomic.com/?SID=o3h5m3r4ei5o3628ij49940u62
X-UA-Compatible: IE=edge
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Varnish: 229728
Age: 0
X-Cache: MISS
Connection: keep-alive

We are running on a dedicated server and also with centOS/cpanel.
Also would a VCL file change be appropriate for this?

Thanks.


texts: Get order ID in custom module's email's subject

texts:
I've a custom module which sends an Pre-order confirmation email to customer before order confirmation email sent to customer.

Once admin reviewed order then only order confirmation triggered.

I would like to include Increment ID in Pre-order confirmation email's subject.

I've tried something like,

{{trans "SiteName Order #%order_id" order_id=$order.increment_id |raw}}

But doesn't seems to work with custom module's email, Whereas it worked with order confirmation email.

Any idea how can I achieve this ?? Help would be appreciated.


texts: Neither FedEx nor USPS shipping methods seem to be functioning in 1.9CE. Does anyone else have experience resolving this issue? I have upgraded two sites from 1.4CE (which were using FedEx and USPS) and now I can only offer flat rate. What next?


texts: F5 key Flood and "Error log record number reporting" page

texts:
I have a VM testing Magento. Configuration is classic LAMP. Everything works fine but I discovered a big issue in running Magento. F5 flood.

1) Visit any page you want.

2) Keep F5 key pressed. Page refreshes in not time.

3) After a few seconds you will get "There has been an error processing your request" title page having content:

There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 535430423605

4) Continue keeping F5 pressed. You can see log number changes. Do this for 2 minutes at least.

5) Go to magento installation forlder then /var/report. You will see tons of logs. All of them telling you "User admin already has more than 'max_user_connections' active connections"

Conclusion

1) The number of logs is huge. Same IP, session, same user, why tons of logs? Just one should be fine!

2) Size space for every log file is around 3k. In 60 seconds I could get 20M occupied with the logs. Imagine someone who will continue for 1 day how big will become the size of report folder.

Question

1) Is there any option in Magento to prevent such of abuse from reloading a page and not generating tons of reports or even the report page? Like making the visitor you have a cache server or load balancing because he can keep 5 minutes F5 and when he release the key everything loads as normal. Having just one report and other page then the one with error report and seeing lots of new error report is not normal, this really push to abuse a visitor seeing something like that.

2) What is the best way to get rid off this situation, generation error report situation, this ugly page?

Thank you!


texts: Shopping Cart Rule based on configurable products

texts:
Is it possible to set up a shopping cart rule as follows:

if any combination of 3 'child' products of a configurable product are added to the cart, add a discount.

ie: if we're talking about t-shirts, the customer could add 2 red and 1 blue, or 3 blue and still get the discount.


texts:
I want to read the XLS file using Magento2
I downloaded PhpOffice\PhpSpreadsheet library using composer  and we have the following code
    <?php
namespace Test\Hello\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use \Magento\Framework\App\Filesystem\DirectoryList;
use \Magento\Framework\Filesystem;
use Psr\Log\LoggerInterface;
use \PhpOffice\PhpSpreadsheet\IOFactory;

class ReadFile extends Action
{
    protected $sftp;
    protected $_storeManager;

    public function __construct(
        LoggerInterface $logger,
        Filesystem $filesystem,
        IOFactory $xls,
        Context $context
    ) {
        $this->logger = $logger;
        $this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
        $this->xls = $xls;
        parent::__construct($context);
    }

    public function execute()
    {
        $filename = $this->directory->getAbsolutePath().'export/test.xls';
        $spreadsheet = $this->xls->load($filename);
        var_dump($spreadsheet);

    }
}

Compile time error

Class PhpOffice\PhpSpreadsheet\IOFactory does not exist   Class
Test\Hello\Controller\Index\ReadFile\Interceptor generation e
rror: The requested class did not generate properly, because the
'generated   ' directory permission is read-only. If --- after running
the 'bin/magento   setup:di:compile' CLI command when the 'generated'
directory permission is   set to write --- the requested class did not
generate properly, then you mu   st add the generated class object to
the signature of the related construct    method, only.

and fatal error when I run this controller.
Fatal error: Uncaught Error: Cannot instantiate abstract class PhpOffice\PhpSpreadsheet\IOFactory

Any Idea what is going wrong here , I already make sure that PhpOffice\PhpSpreadsheet library is there under vendor using
composer require phpoffice/phpspreadsheet


texts: Retrieve all cart data for logged in customer in Magento 2

texts: I need to process all stored cart data that exists in magento site for logged in customer, is there any function to retrieve this data ?


texts: Can not acces Magento API log file. Details are available in Magento log file. Report ID: webapi-5b7e549729324

texts:
We are trying to access via rest-API and search orders via [increment_id], so we are using this GET:

<web>/rest/V1/orders?searchCriteria[increment_id][value]=068550002

Is this line correct? As an answer I get:

  {
      "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-5b7e549729324"
  }

But I can't access var/report/api, there isn't any folder created.

Any idea? Thank you.


texts: Catalog images resize command not working in Magento 2?

texts:
Catalog images not resizing as per view.xml dimensions.

php bin/magento catalog:images:resize

This command run successfully but still not resizing images.

What is the reason behind it? Can somebody help me to resolve this issue?

Thanks.


texts: Call to undefined method on custom collection Resource Model

texts:
I have been trying to figure this out for 2 days.
I created a custom collection for my module structured as follows

  app/code/Morello/Customproducts/Model/CustomProducts.php

namespace Morello\Customproducts\Model;

use Magento\Framework\Model\AbstractModel;

class CustomProducts extends AbstractModel
{
    protected function _construct()
    {
        $this->_init('Morello\Customproducts\Model\ResourceModel\CustomProducts');
    }
}

  app/code/Morello/Customproducts/Model/ResourceModel/CustomProducts.php

namespace Morello\Customproducts\Model\ResourceModel;

use Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class CustomProducts extends AbstractDb
{
    protected function _construct()
    {
        $this->_init('customer_products', 'customproduct_id');
    }
}

  app/code/Morello/Customproducts/Model/ResourceModel/CustomProducts/Collection.php

namespace Morello\Customproducts\Model\ResourceModel\CustomProducts;

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

class Collection extends AbstractCollection
{

    protected function _construct()
    {
        $this->_init('Morello\Customproducts\Model\CustomProducts', 'Morello\Customproducts\Model\ResourceModel\CustomProducts');
    }

}

In my observer I use the CustomProductsFactory and call methods on it. addFieldToSelect, addFieldToFilter, load, setData and save all work, but when I try to call the delete method to remove an entry in the table it throws a fatal error

  Fatal error: Uncaught Error: Call to undefined method Morello\Customproducts\Model\ResourceModel\CustomProducts\Collection::delete() in etc...

What am I missing? The Collection class in the ResourceModel\CustomProducts folder extends the right framework class...

Any help is appreciated.

EDIT:

This is a very simplified version of my observer...

  app/code/Morello/Customproducts/Observer/Backend/CustomerSaveAfter.php

namespace Morello\Customproducts\Observer\Backend;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Morello\Customproducts\Model\CustomProductsFactory;

class CustomerSaveAfter implements ObserverInterface
{

    private $customProductsFactory;

    public function __construct(
        CustomProductsFactory $customProductsFactory
    )
    {
        $this->customProductsFactory = $customProductsFactory;
    }

    public function execute(Observer $observer)
    {
        $customerId = '1';
        $productsToRemoveFromCustomer = array(1, 3, 27);

        $customProductModel = $this->customProductsFactory->create();
        $customProductCollection = $customProductModel->getCollection();

        $customProductCollection
            ->addFieldToSelect('customproduct_id')
            ->addFieldToFilter(
                'customer_id',
                ['eq' => $customerId ]
            )->addFieldToFilter(
                'product_id',
                ['in' => $productsToRemoveFromCustomer ]
            )
            ->load();
            ->delete();
    }
}


texts:
When I send mail from contact us page on SUBMIT, following error was displayed.

  "Unable to send mail: Unknown error".

Please find below image

I am working in localhost with Magento 2.3. When I fill the form under the contact us page (myurl/contacts/), following error display.


texts:
I need to rewrite newsletter module. I nedd to add some fields to database and grid. And I need to change the form.
What is the best way to do it in magento2? Shoud I add fields to newsletter_subscriber table, or should I use eav attributes?
There is any tutorial or example how to rewrite entire core module in magento 2?


texts: How to disable ElasticSearch using terminal?

texts:
I was using ElasticSearch in my old server and then I migrate the server for a new one that it's not using it anymore, so I'm receiving this issue message below.

Exception #0 (Elasticsearch\Common\Exceptions\NoNodesAvailableException): No alive nodes found in your cluster

I could I change the search engine to the default using terminal?


texts: Patch SUPEE-6788 and catalog/navigation blocks

texts:
I applied the patch SUPEE-6788 from 1.9.2.1 and had a issue with a catalog/navigation block type.

I have this in a CMS static block:

{{block type="catalog/navigation" name="categoryLandingPage" template="catalog/category/landing.phtml"}}

And it no longer shows that block; no errors in the log, or var/report folder.

I have other static blocks with the block type of core/template and they are working fine. Right now, I think it has something to do with the APPSEC-1063 section of the patch.


texts: Magento 2.3.6 All emails stopped working even though Magento says it's being sent successfully

texts:
I'm running Magento 2.3.6 with PHP version 7.3 and recently my Magento emails have all stopped working. I'm able to run a PHP script from the server to send emails through the mail function and they're being received, but inside Magento all emails have stopped working.
I've tried looking in the system.log and debug.log, but there are no references to any email errors because Magento fully believes that all emails are being sent correctly. My configurations are set correctly, Disable Emails is set to no, Async email sending is set to disable. All my orders say that confirmation email is sent. Magento thinks everything is fine, but I'm just not getting any emails.
I've also tried installing Mageplaza SMTP extension to bypass any Magento mailing and I'm able to successfully send a test email, but again all other emails do not work.
Hope anyone has ideas, thanks.


texts: Magento 2.2.0 admin developer configuration

texts: When I do mode show in my CLI it shows that I've developer mode on but it still wont show developer configuration ? Why is that , Is that removed.


texts: Determine if installed extensions are free or paid

texts: My magento site contains lot of extensions. I want to know which are among them are free and which are to be purchased (not free). Is there any way to find this ? Thanks in advance.


texts: How to disable product count in category sidebar, but not layered nav

texts:
In a category view, Magento shows the product count of any child categories in the sidebar next to their names. When the viewed category is un-anchored, it only counts products explicitly assigned to that child but not to any deeper children it may have.

We have many high-level categories that have few or no products directly assigned but contain child categories that have lots of products.

Is there a means via the admin (as opposed to editing templates) to display this product count only for our lower-level categories (which are anchored/layered nav) and hide it for those higher-level (un-anchored) ones?


texts:
I've a customer who needs a specific workflow for orders placed via backoffce.

I've searched for an extension and so far i've found none.

The workflow is the following: The admin creates and order via backend and then select a specific payment method. Upon order placement the customer receives an email with a link to make the payment, once the payment is made the order goes to Processing. The payment method can be any method as longs it supports this.

Regards


texts: Using getChildHtml() to add a block in footer.phtml [SOLVED]

texts:
I found a lot of similar titles but none of them help me out of my issue.

I'm about to insert a block into the footer section on all pages so I added below code at the end of:

  app/design/frontend/company/theme/layout/local.xml

just before the </layout> tag.

<!-- Instagram Scroller -->
<default> <!-- to display on all pages -->
    <!-- if name="head" exists then put in the existing tag -->
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/instashow/jquery.instashow.packaged.js</name></action>
    </reference>

    <reference name="footer">
        <block type="core/template" name="instascroller_script" template="instascroller/script.phtml"/>
    </reference>
</default>

And I put my content in

  app/design/frontend/company/theme/template/instascroller/script.phtml

Then I put below code in

  app/design/frontend/company/theme/template/page/html/footer.phtml

<div class="instascroller">
    <?php echo $this->getBlockHtml('instascroller_script'); ?>
</div>

  Then Flush the cache

---- SOLVED ----

Thanks to everyone who viewed, commented, answered this question.

First of all, I should place the <reference name="footer"> in the <default> tag. This solved my issue of not appearing on all pages.

Secondly, I should put <action method="addItem"> in the existing <reference name="head"> tag but I mistakenly created another one.

At last, I forgot to flush the cache.

I updated my question and wish this can help others.

Again thanks to everyone.


texts:
I need to currency rate by currency code in magento 2.

$currency =  $objectManager->get('Magento\Framework\Pricing\PriceCurrencyInterface');
$currencySymbol = $currency->getRate('USD');

I tried above code it returns fatal error.