texts: How to hit controller on saving my data of Store->Configuration in Magento 2?

texts:
I have created some setting in Store->Configuration in Magento 2 i want to hit a controller if the setting is changed otherwise the i want the controller didn't hit.
How would i do that ?
My observer file path ( app/code/Custom/Code/Observer/ConfigObserver.php )
<?php

namespace Custom\Code\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer as EventObserver;
use Psr\Log\LoggerInterface as Logger;
use Magento\Catalog\Model\Product\Attribute\Source\Status;
use Magento\Catalog\Model\ResourceModel\Product\Action;

class ConfigObserver implements ObserverInterface
{
/**
 * @var Logger
 */
protected $logger;
private $productAction;
protected $_productCollectionFactory;
protected $_pageFactory;
private $scopeConfig;
private $_objectManager;

/**
 * @param Logger $logger
 */
public function __construct(
    Logger $logger,
    Action $productAction,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Magento\Framework\View\Result\PageFactory $pageFactory,
    \Magento\Framework\ObjectManagerInterface $objectmanager,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
) {
    $this->logger = $logger;
    $this->productAction = $productAction;
    $this->_pageFactory = $pageFactory;
    $this->scopeConfig = $scopeConfig;
    $this->_objectManager = $objectmanager;
    $this->_productCollectionFactory = $productCollectionFactory;
}

public function execute(EventObserver $observer)
{
    $attributes = [
        'status' => 2,
        'price' => 123
    ];
    $productIds = array(10);
    $storeId = 0;
    $this->productAction->updateAttributes($productIds, $attributes, $storeId);
}
}

system.xml file path ( app/code/Custom/Code/etc/adminhtml/system.xml )
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
    <tab id="am_general" translate="label" sortOrder="10">
        Rule configuration
    </tab>

        <class>separator-top am-general-admin-tab-general</class>
        Rule Section
        <tab>am_general</tab>
        <resource>Custom_Code::general_config</resource>
        <group id="prices" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
            Rule settings
            <field id="add_item" translate="label" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="1">
                Rule based on price
                <frontend_model>Custom\Code\Block\Adminhtml\Menu\Field\AdditionalItem</frontend_model>
                <backend_model>Custom\Code\Block\Adminhtml\Menu\Config\Backend\AdditionalItem</backend_model>
            </field>
        </group>

</system>

And my event name is admin_system_config_changed_section_am_shipping.
Any help is appreciated.


texts: Ajax Controller Not Redirect to login page

texts:
I have Custom Ajax Call, If Customer not login in, then redirected to Login page. But Controller call this code, its says redirected, its not redirected.

Reference:

My Code:

                <?php

      namespace Vendor\Module\Controller\Index;
      use Magento\Framework\Controller\Result\JsonFactory;

      class CustomImage extends \Magento\Framework\App\Action\Action
      {
          protected $logger;
          protected $_productRepositoryFactory;
          protected $_storeManager;
          protected $customerSession;
          protected $resultJsonFactory;

          public function __construct(
              \Magento\Framework\App\Action\Context $context,
              \Psr\Log\LoggerInterface $loggerinterface,
              \Magento\Customer\Model\Session $customerSession,
              \Magento\Catalog\Api\ProductRepositoryInterfaceFactory $productRepositoryFactory,
              JsonFactory $resultJsonFactory,
              \Magento\Store\Model\StoreManagerInterface $storeManager

          )
          {
              parent::__construct($context);
              $this->logger = $loggerinterface;
              $this->_productRepositoryFactory = $productRepositoryFactory;
              $this->_storeManager = $storeManager;
              $this->customerSession = $customerSession;
          }

          /**
           * Execute view action
           *
           * @return \Magento\Framework\Controller\ResultInterface
           */
          public function execute()
          {
              $this->logger->addDebug("Custom Image Block");
              try {

                  $this->logger->addDebug("try Block");
                  if ($this->customerSession->isLoggedIn()) {

                      //my code

                  } else {
                                    $response = [
                'errors' => false,
                'message' => __('Added Item successful.')
            ];
            //If not not login and check isXml Http request(Ajax)
            if(!$this->customerSession->isLoggedIn() && !$this->getRequest()->isXmlHttpRequest()) {
                $response['errors'] = true;
                $response['message'] = 'Error Here';
                $response['redirectUrl'] = $this->_url->getUrl('customer/account/login');
                /** @var \Magento\Framework\Controller\Result\Json $resultJson */
                $resultJson = $this->resultJsonFactory->create();
                $resultJson->setData($response);
                return $resultJson;
            }
                  }

              } catch (Exception $e) {
                  $this->messageManager->addError($e->getMessage());
              }

          }
      }

My ajax.js

  define(["jquery"], function ($) {
      var main =
          function (config) {
              $("#finish_design_button").on("click", function () {
                  execCommand(config);
              });
          }
      //ajax request for load docker
      function execCommand(config) {
          $.ajax({
              url: config.custom_image,
              type: 'POST',
              showLoader: true,
              dataType: 'json'
          }).done(function (response) {
              console.log(response);

              if (response.redirectUrl) {
                  window.location.href = response.redirectUrl;
              }
          });
      }
      return main;

  });

My Template:

  <script type="text/x-magento-init">
      {
          "*": {
              "Vendor_Module/js/custom_image":{"custom_image":"<?php echo $block->getUrl('greeting/index/customimage', []); ?>"}
          }
      }
      </script>

Now,Thorw TypeError: response is null.

Suggest Me, whats Wrong in my code and  how to get response from Controller.


texts: Magento WSDL file the same for each store

texts: Is the WSDL file generated from each store the same with regards to structure and available components or is it different for each store (can each store define its own datatypes etc.) I am wondering this, as the SOAP v2 API for Magento 1 has the same methods/operations regardless of customisations?


texts: Custom form fields required but not shown

texts:
I'm trying to fix a overriden form, which has seven fields required by the form validator, but don't displayed. I found, reading the source code, that all of them are present, but hidden, which means the template is being actually overriden.

Having a look into the eav_attribute table, I found that all the fields has the field is_required set to 1 (which makes sense) but four of seven fields are twice, with the entity_type_id field set to 1 and 2 (customer and customer_address, according to eav_entity_type table).

The install-1.0.0.1.php script has a visible_on_front field set to 1 too (which is not present in the eav_attribute).

I don't get how a form field can be disabled (or hidden) but still being requested. So, the question is: how I make visible those custom fields?


texts: Why is 'sales order place after' observer not executed in 1.9.1 but it is in 1.8.0

texts:
I have created a module for listening to the event sales_order_place_after. I did it following the article http://www.atwix.com/magento/auto-invoice-and-custom-order-status-upon-checkout.

I use it for set my order to processing status, because it's always changed to pending that I set with new order status.

The module works in Magento 1.8.0, but it doesn't work in magento 1.9.1. How could I resolve this problem? Please help me

This is how the module is built:

First, I create a module initializer in /app/etc/modules/Atwix_Orderhook.xml with following content

<?xml version="1.0"?>
<config>
    <modules>
        <Atwix_Orderhook>
            <active>true</active>
            <codePool>community</codePool>
        </Atwix_Orderhook>
    </modules>
</config>

then I create a module configuration file  /app/code/community/Atwix/Orderhook/etc/config.xml with content

<?xml version="1.0"?>
<config>
    <modules>
        <Atwix_Orderhook>
            <version>1.0</version>
        </Atwix_Orderhook>
    </modules>

    <global>

        <models>
            <orderhook>
                <class>Atwix_Orderhook_Model</class>
            </orderhook>
        </models>

        <events>
            <sales_order_place_after>
                <observers>
                    <auto_invoice_order>
                        <type>singleton</type>
                        <class>Atwix_Orderhook_Model_Observer</class>
                        <method>implementOrderStatus</method>
                    </auto_invoice_order>
                </observers>
            </sales_order_place_after>
        </events>

    </global>
</config>

finally I create the app/code/community/Atwix/Orderhook/Observer.php with following content

<?php

class Atwix_Orderhook_Model_Observer
{
    public function implementOrderStatus($event)
    {
        $order = $event->getOrder();
        if ($this->_getPaymentMethod($order) == 'cwinline') {
            $this->_processOrderStatus($order);
        }
        return $this;
    }

    private function _getPaymentMethod($order){        {
        return $order->getPayment()->getMethodInstance()->getCode();
    }

    private function _processOrderStatus($order){
        $status = $order->getPayment()->getStatus();
        if($status=='SUCCESS'){
            $this->_changeOrderStatus($order);
        }
        return true;
    }

    private function _changeOrderStatus($order){
    $statusMessage = 'payment success';
    $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING,Mage_Sales_Model_Order::STATE_PROCESSING,$statusMessage, false);
    $order->save();
    }
}
?>


texts: Can somebody give me a tutorial link to install magento on Centos8?

texts: Can i get a link to some kind of tutorial that works for installing magento 2 on centos 8 i try to follow what is currently on google but they dont work.


texts:
We have currently some process indexing in running.

How I can stop this?

We tried already some things like:

mysql restart, didn't worked as we could not do it
mysql kill -9, didn't worked, but we could kill it, but the index process still running

I tried to find some lock files, but I didn't found any.

Any clue, what else we can check?

We are using Magento 1.9.1


texts: set magento search keyword default not display

texts: how can i set the search keyword (input by customer) default display to "NO" in magento backend so i can moderate the suggested search keyword below the searchbar?


texts: Reindex price issue (value list does not match column list)

texts:
Someone has used the Innoext_AdvancePricing module?
After upgreade to Magento 1.7 reindex crashes or inserts invalid data.

Crash stack trace:

Exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1' in lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 lib/Zend/Db/Statement.php(320): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#4 lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#5 app/code/local/Innoexts/AdvancedPricing/Model/Mysql4/Catalog/Product/Indexer/Price/Configurable.php(222): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#6 app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php(50): Innoexts_AdvancedPricing_Model_Mysql4_Catalog_Product_Indexer_Price_Configurable->_applyConfigurableOption()
#7 app/code/local/Innoexts/AdvancedPricing/Model/Mysql4/Catalog/Product/Indexer/Price.php(167): Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable->reindexAll()
#8 /app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Innoexts_AdvancedPricing_Model_Mysql4_Catalog_Product_Indexer_Price->reindexAll()
#9 app/code/core/Mage/Index/Model/Process.php(209): Mage_Index_Model_Indexer_Abstract->reindexAll()
#10 app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#11 shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#12 shell/indexer.php(198): Mage_Shell_Compiler->run()
#13 {main}

Invalid data in catalog_product_index_price table:

currency is always '0.0' (should be EUR, GBP etc)
store_id is always 0

I will be grateful for any help.


texts: Using PO / Check moneyorder "checkmo" for 0 dollar orders

texts:
We use the Check Money order payment method as "invoice" payment.
We also want to use this payment method for $0 orders.

but now when we select it we get "The requested Payment Method is not available."

Does anyone know a workaround. i've searched a lot but turned up with nothing :(


texts: Please give the solution regarding the error

texts:
Please Help me i found this error.

  Uncaught Error: [object Object]
      at Object. (/looper/en/pub/static/frontend/Szdev/loopper/en_US/Magento_Customer/js/customer-data.js:92)
      at fire (/looper/en/pub/static/frontend/Szdev/loopper/en_US/jquery.js:3232)
      at Object.fireWith [as rejectWith] (/looper/en/pub/static/frontend/Szdev/loopper/en_US/jquery.js:3362)
      at done (/looper/en/pub/static/frontend/Szdev/loopper/en_US/jquery.js:9842)
      at XMLHttpRequest.callback (/looper/en/pub/static/frontend/Szdev/loopper/en_US/jquery.js:10311)


texts: Magento 2 - where is customer registration being handled?

texts:
I created a new field for the registration form.
When a user tries to register, I have to confirm that this new field is filled correctly by the user.

Where can I do that // Where can I find a tutorial?

Thanks!:)


texts:
Okay, so I just want a CMS page that has toggled content, but there seems to be some conflict. How would I resolve this code to work for Magento 2 CMS?

Projects

Projects with our products

Residential

Commercial

Residential

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Commercial

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

and then the jquery in magento:

define([
  "jquery"
], function(jQuery){

!function ($) {

  "use strict"; // jshint ;_;

 /* TAB CLASS DEFINITION
  * ==================== */

  var Tab = function ( element ) {
    this.element = $(element)
  };

  Tab.prototype = {

    constructor: Tab

  , show: function () {
      var $this = this.element
        , $ul = $this.closest('ul:not(.dropdown-menu)')
        , selector = $this.attr('data-target')
        , previous
        , $target
        , e;

      if (!selector) {
        selector = $this.attr('href');
        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); //strip for ie7
      }

      if ( $this.parent('li').hasClass('active') ) return;

      previous = $ul.find('.active a').last()[0];

      e = $.Event('show', {
        relatedTarget: previous
      });

      $this.trigger(e);

      if (e.isDefaultPrevented()) return;

      $target = $(selector);

      this.activate($this.parent('li'), $ul);
      this.activate($target, $target.parent(), function () {
        $this.trigger({
          type: 'shown'
        , relatedTarget: previous
        })
      })
    }

  , activate: function ( element, container, callback) {
      var $active = container.find('> .active')
        , transition = callback
            && $.support.transition
            && $active.hasClass('fade');

      function next() {
        $active
          .removeClass('active')
          .find('> .dropdown-menu > .active')
          .removeClass('active');

        element.addClass('active');

        if (transition) {
          element[0].offsetWidth; // reflow for transition
          element.addClass('in');
        } else {
          element.removeClass('fade')
        }

        if ( element.parent('.dropdown-menu') ) {
          element.closest('li.dropdown').addClass('active')
        }

        callback && callback()
      }

      transition ?
        $active.one($.support.transition.end, next) :
        next();

      $active.removeClass('in')
    }
  };

 /* TAB PLUGIN DEFINITION
  * ===================== */

  $.fn.tab = function ( option ) {
    return this.each(function () {
      var $this = $(this)
        , data = $this.data('tab');
      if (!data) $this.data('tab', (data = new Tab(this)));
      if (typeof option == 'string') data[option]()
    })
  };

  $.fn.tab.Constructor = Tab;

 /* TAB DATA-API
  * ============ */

  $(function () {
    $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
      e.preventDefault();
      $(this).tab('show')
    })
  })

}(jQuery);


texts:
I am wondering is it possible to install Magento 2 with a shell script?

Like we run shell script and Magento 2 will be installed automatically?

Just like softaculous on cpanel ?

Any help will be appreciated.

Thanks.


texts:
How can i execute something like full join in magento 2 then set query data in my collection. Below i try to do somethig.

$joinLeftCustomerSql = $connection
        ->select()
        ->from("$webSubscriberTable AS web_subscriber", ['token'])
        ->joinLeft(['customer' => $customerTable], 'web_subscriber.customer_id=customer.entity_id', 'email');

    $joinRightCustomerSql = $connection
        ->select()
        ->from("$webSubscriberTable AS web_subscriber", ['token'])
        ->joinRight(['customer' => $customerTable], 'web_subscriber.customer_id=customer.entity_id', 'email');

    $collection->getSelect()->reset()->union([$joinLeftCustomerSql, $joinRightCustomerSql]);

It is proper query but latter i have next problem No table has been specified for the FROM clause. After research i found out that magento can't do query COUNT(*) with my query and i need to build something like this:

SELECT * FROM (myquery) AS test

myquery -  $collection->getSelect()->reset()->union([$joinLeftCustomerSql, $joinRightCustomerSql]);

and i try execute this query

$fullSqlToUnion = $connection->select()->union([$joinLeftCustomerSql, $joinRightCustomerSql]);

    $collection->getSelect()->reset()->from($fullSqlToUnion);

But it don't work because magento make quote around my query in FROM.


texts: Desktop theme is loading in both mobile and desktop

texts:
I want to set two different themes for desktop view and mobile view. After all configuration also the mobile theme is not coming in mobile view , instead its loading the desktop theme.

My mobile theme is here : mobile view -  skin/frontend/default/iphonegfbs/css/iphone.css

Desktop theme is here :desktop view - skin/frontend/rwd/default/css/styles.css


texts: Table text size larger then normal after moving server

texts:
I have recently moved my Magento installation to a new server and for some reason, the text in certain areas is larger then it used to be. As if the CSS is not working.

Anybody have a clue as to why this is happening?


texts: magento 2: I want display a image in the module template phtml file

texts: I want to display an image in the module template file. When somebody installs my module, he can see that image. Can I store my images inside my module directory or not?


texts: Category has not been created. URL key for specified store already exists

texts:
I am trying to upload my stock through the Magento 2 admin panel via CSV.
I am getting the following error:

  Category "Default Category/Aftermarket and Parts/Spare Parts/ Fasteners/Screws and Bolts/603-25008" has not been created. URL key for the specified store already exists. in row(s): 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085

I have tried the following SQL queries to remove any potential duplicates:

delete FROM cataloginventory_stock_item
where product_id not in(SELECT entity_id FROM catalog_product_entity);

But I still cannot upload my complete CSV file.


texts: Define own directory name for Magento composer extension

texts:
My Magento environment is structured as following:

composer.json which includes "aoepeople/composer-installers": "*" and a list of Magento modules that deploy the code into my .modman directory.  From here, i deploy the files through modman deploy-all into the Magento root folder.

So these are my steps, when a new extension update is available:

composer update
Inspect changes of the module code in the .modman folder
git commit
modman deploy-all
git push: Starts remote Magento deployment

This works as expected.

When i use the package avstudnitz/scopehints or mb/translate in my composer.json, the folders .modman/scopehints and .modman/translate are created. However, i would prefer a foldername including the vendor name, like the name of the Magento module itself, such as .modman/AvS_ScopeHint and .modman/MB_Translate for clarity.

Is there a way to define the composer deploy foldername for each Magento package?


texts: What;s the difference between these two? Can't find an answers anywhere.


texts: Why is Magento not discounting my cart with the full discount amount?

texts:
I have a cart with 2 items added:

Product 1 for £100
Product 2 for £65

Product 2 is effectively a free gift, and to achieve this an automatic £65 discount is applied to the entire cart using a Shopping Cart Rule.

The customer is then applying a manual £20 discount from a voucher code they have.

The discount that should be applied at this point is £85 (£65 + £20), but what is actually applied is £77.12.

After a bit of number crunching it looks like Magento applies the £20 discount in a pro-rota fashion, working out the percentage that each product in the cart of the entire value is responsible for, and then applies that percentage discount of the £20 to each row individually.

In this example, it tries to apply £12.12 discount to Product 1 and £7.88 discount to product 2, which in the cart would total £20.

However, because product 2 has already been discounted by £65 Magento is not applying that £7.88 pro rota discount at all, so the cart is being discounted by an incorrect value of £77.12 (£65 + £12.12).

The £20 voucher is set up as follows:

Conditions:

Subtotal >= £60.

Actions:

Fixed amount discount for whole cart of 20. Everything else set to '0' or 'No'.

The automatic £65 discount is set up as follows:

Conditions:

Total amount >= £95, with a sub-condition excluding some SKUs.

Actions:

Fixed amount discount for whole cart of £65, everything else '0' or 'No'.
Apply to only: X,Y,Z SKUs


texts: Rounding mistake after editing a product

texts:
if I want to add a new Product (sale price 39,99) I can set the price like this: 33,60504201680672 (without tax).

The price in the shop is now shown correct: 39,99.

If I edit then the product, the price is in backend 33,61 and in frontend 40,00.

I already set the rounding decimal place in Store.php from 2 up to 4.

The Magento version is 1.7.0.2.

Can anybody help?


texts: display product present only in both category 1 and category 2

texts:
I am trying to display only those products which are present in both category 1 and category 2
or in other words
only those products which are present in both parent category and its sub category
I tried this:

$collection = Mage::getModel('catalog/product')
        ->getCollection()
        ->distinct(true)
        ->addAttributeToSelect('*')
        ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
        ->addAttributeToFilter('category_id',$parentcategory)
        ->addAttributeToFilter('category_id',$subcategory ); Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);

  foreach($collection as $product){ echo $product->getId(); }

EDIT:I used this to get product id but its giving error  of getId on non-object


texts: Create shipment programmatically and facing error

texts:
I am trying to create shipment programmatically. Following a tutorial, but facing error on save shipment.

Here is the code that I am using:

$orderId = 100002156;
$order = $this->_orderRepository->get($orderId);

if (!$order->canShip()) {
    echo "Can't Ship";
    die;
}

$orderShipment = $this->_convertOrder->toShipment($order);

foreach ($order->getAllItems() AS $orderItem) {

    if (!$orderItem->getQtyToShip() || $orderItem->getIsVirtual()) {
        continue;
    }

    $qty = $orderItem->getQtyToShip();
    $shipmentItem = $convertOrder->itemToShipmentItem($orderItem)->setQty($qty);

    $orderShipment->addItem($shipmentItem);
}

$orderShipment->register();
$orderShipment->getOrder()->setIsInProcess(true);

$this->save();
$this->getOrder()->save();

Can anyone tell what is the issue?


texts: How to access the details of a logged in user

texts:
Our Society wishes to have some web pages outside Magento (1.9) but on the same web server and to control access to those pages according to the credentials of a person logged in to Magento.

Initially, we would like a page that is only visible to people logged in and belonging to a specific customer group.

Following on from that we would like to be able to control what features appear on a web page according to the person logged in.

On our previous non-e-commerce site the above was achieved by PHP pages that
1. used the logged-in details from phpBB
2. comparison of the logged-in person's id with authorities recorded in a MySQL database.

So I'm happy to write fairly simple things in PHP and SQL (procedural rather than object-oriented approach) but I have no knowledge of the inner workings of Magento.


texts: “404 error: Page not found” without doing any changes. Backend works fine

texts: I do not know what happend to the website. The only thing I did was that I flushed the cache of the website hoping to make it faster. Please help me identify what went wrong?


texts: Importing Attribute Price on Vague Feeds

texts:
This is less a programming question and more a process/policy question.

When dealing with product feeds from manufactures/resellers, it's very common to run into a product variant that looks something like this

Size        Color       price
--------------------------------------------------
625 ml      Red         47.70
1.25 litre  Red         69.33
4 litre     Blue        165.98
4 litre     Green       170.78
5 litre     Red         173.56
10 litre    Blue        454.72
10 litre    Green       454.72
16 litre    Yellow      456.96
200 litre   Yellow      4648.00

We have a product with two attributes (Size, Color), and it's unclear how each attribute effects the price.  In the above example you might assume its size that would effect the price (as more product would cost more).  However, comparing two products with the same size

4 litre     Blue        165.98
4 litre     Green       170.78

there's still a slight price different due to color.

When setting these products up as configurable products, how do you split the option price between the two attributes for the Super Product Attributes Configuration?  It doesn't seem like it's possible algorithmically without more information, but I also see feeds like this all over the place so I assume people are finding a way to deal with it.


texts: how to remove the items in checkout for Non-US countries in magento 2.3.0?

texts:
I am writing custom module. customer have multiple address in checkout.but customer is selected country non-us we need remove the all items from checkout.If customer selected country is US items are showing in checkout. Please observe the below screenshot

http://prntscr.com/mhrimo

please help on this matter.


texts: Magento 2 : How to create custom Newsletter Thank you page?

texts: I want to show custom thank you page after hitting the newsletter subscription button. Please help me in this.


texts: What is _init() return what is use of init() function?

texts:
I want to know About what is _init() do in magento?

$this->_initSometext();


texts: Adding a custom link to a top menu / navigation based on a csutom attribute of that category

texts:
Based on a custom category attribute created I want to show a link (right next to the category in drop-down menu), on top navigation.
I tried to achieve via render.ptml where the menus are created, but I couldn't get a category id.
For parent id i was able to get get id from:

$catname= $child->getId();
$catname = explode('-',"$catname");
$parntid=(int)$catname['2'];)

How can I do that for all categories?


texts:
I have a magento on dedicated server but from the past few days the website is giving me hard times. The host provider says its because of Database & asks me to optimize the data. Which i have also optimized. Further this following command on process manager show high consumption of CPU.

"/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --open-files-limit=10000 --pid-file=/var/lib/mysql/xxx-xxx-xxx-xxx.webhostbox.net.pid"

Please let me know what is this command doing & where could be it is coming from. Eagerly waiting for some advise on this.

Regards


texts: Remove tax if subtotal is greater than a specific amount

texts:
Vers. Magento 1.9.3.8

Due to new duties in Australia I need to add taxes on cart if subtotal is lower than 1000 AUD.

So I'm planing to set a specific tax rate for that country, but it should be applied only if the order subtotal is lower than 1000 AUD.

Any help?

EDIT

Creating a specific tax rate is not what i need. In this way taxes are added to products. They should be applied only to "subtotal < 1000 AUD".

EDIT

To acive this result i've created a new Product Tax Class:

Class Name: Australian GST
Class Id: 6

a new Tax Rate:

Country: Australia
Rate:10

and a new Tax Rule to associate them.

Then I've created an observer fo the event:

sales_quote_collect_totals_before

Observer.php

<?php
class MyCompany_AdditionalTaxes_Model_Observer
{
    public function addTaxes(Varien_Event_Observer $observer)
    {
        $quote = $observer->getQuote();
        $country = $quote->getShippingAddress()->getCountryId();

        if ($country == 'AU') {
            $currency = $quote->getQuoteCurrencyCode();

            if ($currency == 'AUD') {
                $subtotal = $quote->getSubtotal();
            } else {
                $baseCurrencyCode = Mage::app()->getBaseCurrencyCode();
                $currencyRates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array('AUD'));
                $base_subtotal = $quote->getBaseSubtotal();
                $subtotal = $base_subtotal*$currencyRates['AUD'];
            }

            if ($subtotal < 1000) {
                foreach ($quote->getAllItems() as $item){
                    $product = $item->getProduct();
                    $product->setTaxClassId(6);
                }
            }
        }
        return $this;
    }
}

It seems to work fine for cart and checkout page.

If country is Australia and subtotal is lower than 1000AUD tax rate of 10% is applied. In all other cases normal configuration of taxes is applied.

I've still got problem with PayPal Express Checkout.

The callbak API hits shippingOptionsCallbackAction()

public function shippingOptionsCallbackAction()
{
    try {
        $quoteId = $this->getRequest()->getParam('quote_id');
        $this->_quote = Mage::getModel('sales/quote')->load($quoteId);
        $this->_initCheckout();
        $response = $this->_checkout->getShippingOptionsCallbackResponse($this->getRequest()->getParams());
        $this->getResponse()->setBody($response);
    } catch (Exception $e) {
        Mage::logException($e);
    }
}

but when quote is loaded with

Mage::getModel('sales/quote')->load($quoteId);

seems to ignore the observer


texts: Magento 2 : Add validation for tax/Vat number

texts:
Can any one tell me how can i add validation for Tax/Vat number field.
I want to make it numeric.
https://prnt.sc/ouycdv
What i have done till now in taxvat.phtml is

<input type="number" id="<?= $block->escapeHtmlAttr($block->getFieldId('taxvat')) ?>" name="<?= $block->escapeHtmlAttr($block->getFieldName('taxvat')) ?>" value="<?= $block->escapeHtmlAttr($block->getTaxvat()) ?>" title="<?= $block->escapeHtmlAttr(__('Tax/VAT number')) ?>" class="input-number <?= $block->escapeHtmlAttr($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('taxvat')) ?>" <?php if ($block->isRequired()) echo ' data-validate="{required:true}"' ?> data-validate="{validate-number : true}">

But only this is not working. what more i have to do? how can i show error message


texts: Magento include src folder have lot of php file

texts:
I am using magento 1.9 in my website. Recently someone hack my website after that i noticed in root folder: includes/src folder have lot's of .php files. All the php files are related to some extension. That available in both extension as well as includes/src.

I don't know it's required files or not can you please any one give some idea about that


texts: How to check delivery method in e-mail template?

texts:
I have an extension in use in my Magento store to display various delivery methods during the checkout.

In my email confirmation template is this piece of code:

Your delivery method:

            {{layout handle="deliverydate_email_information" order=$order}}

The customer can also choose "pick up" to get his goods directly from the store. How can I modify the email template so that the delivery method is only shown if the customer has not selected pick up?

Any hints how I can achieve this?

Thanks!


texts: Do Updating patches updates magento version itself..?

texts:
Need to confirm if we update Magento patches, will it update megento version itself or not..?
Forexample if we have version 1.9.1.1 and i update patches into it, will it update the magento version to 1.9.2.2 after installing patches..?


texts: inet_pton warning when use webserver behinds a reverse proxy

texts:
My server architecture is like below

0.0.0.0:80  =>  127.0.0.1:6081  =>  127.0.0.1:82
  HAProxy          Varnish             Nginx

I trace real client IP by uncommenting these lines in local.xml

<remote_addr_headers><!-- list headers that contain real client IP if webserver is behind a reverse proxy -->
    <header1>HTTP_X_REAL_IP</header1>
    <header2>HTTP_X_FORWARDED_FOR</header2>
</remote_addr_headers>

It can get real client IP properly. In order information, Placed from IP shows only real client IP.

But, I watch system.log, every visit to the website, this log appends:

ERR (3): Warning: inet_pton(): Unrecognized address xxx.xxx.xxx.xxx, 127.0.0.1, 127.0.0.1  in /some/where/overtherainbow/app/code/core/Mage/Core/Helper/Http.php on line 149

xxx.xxx.xxx.xxx is real client IP.

Code snipet from Http.php (line 149 is return line)

 public function getRemoteAddr($ipToLong = false)
    {
        if (is_null($this->_remoteAddr)) {
            $headers = $this->getRemoteAddrHeaders();
            foreach ($headers as $var) {
                if ($this->_getRequest()->getServer($var, false)) {
                    $this->_remoteAddr = $_SERVER[$var];
                    break;
                }
            }

            if (!$this->_remoteAddr) {
                $this->_remoteAddr = $this->_getRequest()->getServer('REMOTE_ADDR');
            }
        }

        if (!$this->_remoteAddr) {
            return false;
        }

        return $ipToLong ? inet_pton($this->_remoteAddr) : $this->_remoteAddr;
    }

$this->_remoteAddr contains 3 IP addresses as string, it causes the warning log.

How to prevent this?


texts: Apply filters or mass actions on grids with fake collection (or wirhout ui components)

texts:
I a admin grid with a change on _prepareCollection() function to get the collection from a response of api call, its working fine. But I do not have the filters or mass functions, how can I do that without ui components?

I have this change on my grid file:

/**
 * Collection
 *
 */
protected function _prepareCollection()
{
    $filter = [
        'query' => 'cat yellow',
        'page' => 1,
        'region' => '',
        'year' => '',
    ];

    $collection = $this->_api->searchCat($filter);

    $this->setCollection($collection);
    return parent::_prepareCollection();
}

If I could simulate a collection, maybe I could use ui components, but I'm lost, how can I resolve my problem?

The idea is use the filter to search cats with cat api, and the mass action is to import those registers into a products.


texts: Magento 2 : Override email/shipment/track.phtml in module

texts:
Is their any way we can override email/shipment/track.phtml ? in module ?
created layout file
view/frontend/layout/sales_email_order_shipment_track.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="tracking">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Mod_Sales::email/shipment/track.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

created template file
view/frontend/templates/email/shipment/track.phtml

Any thoughts what can be the issue ?


texts: Physical location of robots.txt file in Magento 2.2

texts:
Where can I find the location of robots.txt file in the Magento root?

Checked pub folder also.

Any one helps.


texts: Magento 2: Header & Footer Not Displaying in Contact Us Email

texts:
I have created custom module and override contact-us email template. Also, I have changed contact us email type and set html. It's working perfectly. But the problem is when I received email, email header and footer are missing. Logo is not displayed.

Magento version 2.1.7

Here is my code.

module.xml should be [Vendor/RewriteContact/etc/module.xml]

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

email_templates.xml should be [Vendor/RewriteContact/etc/email_templates.xml]

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="contact_email_email_template" label="Contact Form" file="submitted_form.html" type="html" module="Vendor_RewriteContact" area="frontend"/>
</config>

submitted_form.html should be [Vendor/RewriteContact/view/frontend/email/submitted_form.html]

<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<!--@subject {{trans "Contact Form"}} @-->
<!--@vars {
"var data.comment":"Comment",
"var data.email":"Sender Email",
"var data.name":"Sender Name",
"var data.telephone":"Sender Telephone",
"template config_path=\"design\/email\/footer_template\"":"Email Footer Template",
"template config_path=\"design\/email\/header_template\"":"Email Header Template"
} @-->
{{template config_path="design/email/header_template"}}
{{trans "Name: %name" name=$data.name}}
{{trans "Email: %email" email=$data.email}}
{{trans "Phone Number: %telephone" telephone=$data.telephone}}

{{trans "Comment: %comment" comment=$data.comment}}
{{template config_path="design/email/footer_template"}}


texts:
I would like to add new API to
Magento Customer module -> AccountManagementInterface.

I have created my custom module but I don't know how should my di.xml be written?

Thanks~!


texts: Theme broken after update to magento 2.2.2

texts:
Update from Magento 2.1.9 to 2.2.2 has caused my custom theme to break and I have no idea how to get this working again. It seems to be loading luma theme with my custom blocks loading in?

I have tried to di compile and re-deploy static content and setup upgrade but still no luck.

Any ideas on why my theme doesn't work?

Screenshot:
https://ibb.co/kwgxx6

Thanks


texts: How to connect/export the database in Magento DevBox (docker container)?

texts:
I've just setup the DevBox (Beta) with an install of Magento 2 by running through their wizard and executing the install script.

Everything appears to have worked fine, but I can't figure out any method to connect to and export the database.

No instructions on how to do this are given in the official documentation: http://devdocs.magento.com/guides/v2.1/install-gde/docker/docker-over.html

I want to be able to export my dev database so I can import into my production instance. There must be some way to do this, or developing in DevBox would make no sense!


texts:
I am working with a module that has a lot of hard-coded calls to
Mage::getSingleton('checkout/session')->getQuote()
I am trying to call it from Adminhtml and in stead of rewriting a huge chunk of the module, I thought I would set the checkout session quote to the quote stored in my object (which is valid). However when I type the code:

Mage::getSingleton('checkout/session')
    ->setQuote($this->getQuote())
    ->save();

I get the following error:

Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Mage_Core_Model_Config_Element' is not allowed'

Is there a quick way to override the checkout/session's quote?


texts: How to set title in customer navigation tab magento 2

texts:
I am creating custom customer navigation tab using my module.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="customer_account_navigation">
        <block class="Magento\Framework\View\Element\Html\Link\Current"  name="customer-account-navigation-custom-link">
            <arguments>
                <argument name="path" xsi:type="string">link/index</argument>
                <argument name="label" xsi:type="string">Custom link</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>
</page>

When i click on my custom tab its page title is Billing Agreements how to set page title in my custom tab


texts: Get all the frontend blocks template(layout) in admin backend side?

texts:
I will describe the situation in more detail. I create simple extension. In my config.xml i add events.

<events>
     <core_block_abstract_to_html_before>
       <observers>
         <my_info_core_block_abstract_to_html_before>
           <type>singleton</type>
           <class>my_info_Model_Observer</class>
         <method>insertBlock</method>
         </my_info_core_block_abstract_to_html_before>
       </observers>
     </core_block_abstract_to_html_before>
</events>

Then i create my model for observer when my function insertBlock

public function insertBlock($observer) {

/* get data from db */
$my_search_block = Mage::getModel('my/my')->load(1)->getData('data');

$_block = $observer->getBlock();
$_type = $_block->getType();

/* if the block is desired */
if ($_type == $my_search_block) {

$_child = clone $_block;
    $_child->setType('test/block');
    $_block->setChild('child', $_child);
    $_block->setTemplate('my/my.phtml');
}

}

In my back end of extension I want to get all the blocks and give choice of administrator. Then selected block i put into db and in my observe i compare blocks and display my block

I'm trying to get all the blocks but do not know what function it displays the list of blocks.

$layout = Mage::app()->getLayout();
    Zend_Debug::dump($layout);

How get all frontend block template(layout) and child-block in the admin backend?


texts: Retrieve all Products from a category via SOAP API v2 WS-I

texts:
I would like to know how to retrieve products that belong to a specific category in Magento SOAP API V2, with WS-I compliance and also without.

Here's what I've tried in WS-I compliance mode:

$proxy = new SoapClient('http://foobar.local/api/v2_soap/?wsdl');

$sessionId = $proxy->login(array(
    'username' => 'foo',
    'apiKey' => 'bar'
));

$filters = array( 'complex_filter' =>
    array(
        array(
            'key' => 'category_ids',
            'value' => array( 'key' => 'like', 'value' => '%1%' )
        )
    )
);

$result = $proxy->catalogProductList(array('sessionId' => $sessionId->result, 'filters' => $filters));

var_dump($result->result);

I can use the complex filter to successfully filter by product_id however this fails to work for category_ids as it has another nested level. How can I retrieve products via the Magento API for a certain category ID? Should I be using catalog_category.assignedProducts?


texts: Magento 2 how to pass if exist search criteria in rest api call

texts:
I need to filter getList records in my rest api call.
I have following:

  searchCriteria[filter_groups][0][filters][0][field]=city_ref&searchCriteria[filter_groups][0][filters][0][condition_type]=notnull

But it returns all records to me, even if city_ref isn't exist in the record.
I need url parameter like above, because i pass it in ajax.
How to do it?


texts: Magento 2 : Move Custom Block beside to the "Apply Discount Code" section into shopping cart page

texts: In Magento 2, how to move custom block beside to the "Apply Discount Code" section into shopping cart page.


texts: how can i check if a product contains a specific attribute?

texts:
I have an HTML table which displays the attributes of a product inside a block.

   Light Color:

{{block type="core/template"  template="catalog/product/view/light_color.phtml"}}

   Light Source:

{{block type="core/template"  template="catalog/product/view/light_source.phtml"}}

The PHTML file looks like this: (for light_source it is pretty much the same except 'light_color' is replaced with 'light_source' )

<?php
$product_id = Mage::registry('current_product')->getId();
$_product= Mage::getModel('catalog/product')->load($product_id);
$attribute = $_product->getResource()->getAttribute('light_color');
?>
<?php if ($attribute): ?>

<?php echo $attribute_value = $attribute ->getFrontend()->getValue($_product);  ?>

<?php endif; ?>

It works but now it does this for every single product even if it doesn't contain the attribute, if it doesn't contain the attribute it just displays an empty row.
Now comes my problem: I would like to have a way to check if the product contains the selected attribute. If it does it just displays it, if it doesn't contain it, it just doesn't add it to the table.
Any help would be much appreciated!


texts:
I got the following error in my system.log in Magento

Who has an idea how to solve this one?

2016-12-07T11:57:07+00:00 ERR (3): Warning: include(CACHE/BACKEND/CLASS/NAME.php): failed to open stream: No such file or directory  in lib/Varien/Autoload.php on line 94
2016-12-07T11:57:07+00:00 ERR (3): Warning: include(CACHE/BACKEND/CLASS/NAME.php): failed to open stream: No such file or directory  in lib/Varien/Autoload.php on line 94
2016-12-07T11:57:07+00:00 ERR (3): Warning: include(): Failed opening 'CACHE/BACKEND/CLASS/NAME.php' for inclusion (include_path='app/code/local:app/code/community:app/code/core:lib:.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php')  in lib/Varien/Autoload.php on line 94
2016-12-07T11:57:08+00:00 ERR (3): Warning: include(CACHE/BACKEND/CLASS/NAME.php): failed to open stream: No such file or directory  in lib/Varien/Autoload.php on line 94
2016-12-07T11:57:08+00:00 ERR (3): Warning: include(CACHE/BACKEND/CLASS/NAME.php): failed to open stream: No such file or directory  in lib/Varien/Autoload.php on line 94
2016-12-07T11:57:08+00:00 ERR (3): Warning: include(): Failed opening 'CACHE/BACKEND/CLASS/NAME.php' for inclusion (include_path='app/code/local:app/code/community:app/code/core:lib:.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php')  in lib/Varien/Autoload.php on line 94


texts: Product Rating Filter for Layered Navigation

texts: how to implement product rating filter in Layered Navigation? I can't found any tutorial for that..If you have any idea about it then share a link of tutorial or Free Extention.


texts: How to create a new admin layout page in Magento 2?

texts:
I'm attempting to create a new admin page layout for Magento 2. The default ones are:

admin-empty
admin-1coumn
admin-2columns-left

I would like to create a module that extends the default layout with a admin-3columns. How have I to do it?
thanks in advance


texts:
How to catalog search by category id?

Magento 2.x

PHP 7.x


texts: Magento 2.2.5: Exception #0 (InvalidArgumentException): Invalid return type

texts:
i'm doing update "students" on magento 2.2.5
and i'm stuck in how to get student data by id
the error say:

1 exception(s):
Exception #0 (InvalidArgumentException): Invalid return type

here is my code:

<?php

namespace Fudu\HelloWorld\Controller\Adminhtml\Student;

use Magento\Backend\App\Action;
use Fudu\HelloWorld\Model\StudentsFactory;
use \Magento\Framework\Exception\NoSuchEntityException;

class Update extends Action
{

/**
 * @var StudentsFactory
 */
protected $studentsFactory;

public function __construct(
    Action\Context $context,
    StudentsFactory $studentsFactory
)
{
    $this->studentsFactory = $studentsFactory;
    parent::__construct($context);
}

/**
 *  Load Student data by given Student Id
 *
 * @return $student
 * @throws NoSuchEntityException
 */

public function execute()
{

    $id = $this->getRequest()->getParam('id');
    $student = $this->studentsFactory->create();
    $student->load($id);

    return $student;
}
}


texts: How to add additional options when buying a product?

texts:
Please tell me how you can implement this

that at the time of purchase of the product the customer could choose additional products.


texts: The special charcters used in Email subject is not coming properly?How to resolve this issue?

texts:
We have used few special characters in Email subject for French and German language like ä, n°. These letters are converted to "? ".

In email subject, How to resolve this issue?

But these are coming correctly in the email body. Thanks in advance


texts: Increasing all product prices by percentage | Custom Script

texts:
I am trying to find a way to update all product prices by 5% then I want to revert them to the original price and wondered if anyone had any ideas of the best way to achieve this.

At the moment I am trying this:

require 'app/Mage.php';
Mage::app();
$products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('price')
    ;
foreach ($products as $product) {
    $oldPrice = $product->getPrice();
    $increase = 1.05;
    $newPrice = round($oldPrice * $increase , 1);

    $product->setPrice($newPrice);
    $product->save();
}

I got this from an old post regarding Magento 1.4 but it doesn't work.

As I wanted to revert to the original price is there a better way or can someone let me know whats wrong with this code.

I have the script in a folder in ROOT.

Thanks.


texts: Magento 2 extension downloads but does appear in enabled/disabled module list

texts:
I've just downloaded an extension via SSH like this...

composer require magefan/module-blog

It tells me it has downloaded 100% successfully and refreshes the command line.

I then got to check that the extension is available to install like this...

php bin/magento module:status

But the module is nowhere on the list, either disabled or enabled.

I've tried this with three extensions now, and it is the same every time.

Any help would be much appreciated.


texts: How can i add custom category description block?

texts:
i want to add another category description section after the product listing on category view page.

Is it possible without coding in Magento 2.2?
If not how can i put it?


texts:
I am trying to redirect in my controller_action_predispatch observer. However, I got http 500 error, unable to handle the request

Note: I got the error 500 once i include \Magento\Framework\App\Response\Http $http (even if i don't do the redirect logic inside)

What could be the problem?

<?php
namespace Vendor\Name\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class RedirectObserver implements ObserverInterface
{
    protected $accountRedirect;
    protected $session;
    protected $url;
    protected $http;

    public function __construct(
        \Magento\Customer\Model\Account\Redirect $accountRedirect,
        \Magento\Customer\Model\Session $session,
        \Magento\Framework\UrlInterface $url,
        \Magento\Framework\App\Response\Http $http
    ) {
        $this->accountRedirect = $accountRedirect;
        $this->session = $session;
        $this->url = $url;
        $this->http = $http;
    }

    public function execute(Observer $observer)
    {
        if (!$this->session->isLoggedIn()) {
            // redirect to login page
            $this->http->setRedirect($this->url->getUrl('customer/account/login'), 301);
        }
    }
}


texts: On click show/hide contents for brands list

texts:
I would like my brand directory to have a click event. So if a visitor clicks 'A' for example, all brands within A are shown. I have the below code which collates the brands - however, the script I am trying to use to get the click event does not seem to work. Can anyone help? Below is the code exactly as it is in the PHTML file (I am using the script inline).

CODE

        <?php foreach($alph as $letter => $children): ?>

        <?php echo $letter; ?>

                <?php foreach ($children as $child){
                $skin_url = $child->getImageUrl(); ?>

<a href="<?php echo $child->getURL();?>" title="<?php echo $child->getName();?>">
                        <?php echo $child->getName();?>

                <?php   }?>

        <?php endforeach; ?>

Can anyone please suggest an edit to my code to achieve this effect?


texts: I want to fix scrolldown in my vertical dropdown menu when I hover it hides before reaching last elements https://ibb.co/e4OZ3z

texts:
I want to fix scroll-down in my vertical drop-down menu when I hover it hides before reaching last elements https://ibb.co/e4OZ3z
My website url is: https://www.equipus.com/


texts: Translate error message no result from catalog search

texts:
i was looking to find where is writed this message:

  "Maximum words count is 8. In your search query was cut next part:
  test9."

I search it, and found is here:

    <?php echo ($this->getNoResultText()) ? $this->getNoResultText() : $this->__('Your search returns no results.') ?>
    <?php if ($messages = $this->getNoteMessages()):?>
        <?php foreach ($messages as $message):?>

<?php echo $message?>
        <?php endforeach;?>
    <?php endif; ?>

But don't know how could translate this message.

I already try to translate on Mage_CatalogSearch.csv in the appropiate language.

Anyone could help me?


texts: Custom Value not saving in checkout page

texts:
I am making a module to insert a  custom fields to quote address.

My File

Modulename/etc/frontend/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
        <plugin name="impunkj_add_custom_field" type="Impunkj\Checkout\Plugin\Checkout\Model\Checkout\LayoutProcessor" sortOrder="100"/>
    </type>
</config>

Modulename/etc/extension_attributes.xml

<?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\Quote\Api\Data\AddressInterface">
        <attribute code="dropdown" type="string" />
    </extension_attributes>
</config>

Also Layout Processor
Impunkj\Checkout\Plugin\Checkout\Model\Checkout

<?php
namespace Impunkj\Checkout\Plugin\Checkout\Model\Checkout;

class LayoutProcessor
{
    /**
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array
     */
    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {
    $customAttributeCode = 'dropdown';
    $customField = [
        'component' => 'Magento_Ui/js/form/element/abstract',
        'config' => [
            // customScope is used to group elements within a single form (e.g. they can be validated separately)
            'customScope' => 'shippingAddress.custom_attributes',
            'customEntry' => null,
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/input',
            'tooltip' => [
                'description' => 'this is what the field is for',
            ],
        ],
        'dataScope' => 'shippingAddress.custom_attributes' . '.' . $customAttributeCode,
        'label' => 'Custom Attribute',
        'provider' => 'checkoutProvider',
        'sortOrder' => 0,
        'validation' => [
           'required-entry' => true
        ],
        'options' => [],
        'filterBy' => null,
        'customEntry' => null,
        'visible' => true,
    ];
    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children'][$customAttributeCode] = $customField;
    return $jsLayout;
    }
}

Also in
Checkout/view/frontend/require-config.js

var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/action/set-shipping-information': {
                'Impunkj_Checkout/js/action/set-shipping-information-mixin': true
            }
        }
    }
};

File
Modulename/view/frontend/web/js/action/set-shipping-information-mixin.js

/*jshint browser:true jquery:true*/
/*global alert*/
define([
    'jquery',
    'mage/utils/wrapper',
    'Magento_Checkout/js/model/quote'
], function ($, wrapper, quote) {
    'use strict';

    return function (setShippingInformationAction) {

        return wrapper.wrap(setShippingInformationAction, function (originalAction) {
            var shippingAddress = quote.shippingAddress();
            if (shippingAddress['extension_attributes'] === undefined) {
                shippingAddress['extension_attributes'] = {};
            }

            shippingAddress['extension_attributes']['dropdown'] = shippingAddress.customAttributes['dropdown'];
            // pass execution to original action ('Magento_Checkout/js/action/set-shipping-information')
            return originalAction();
        });
    };
});

Is there anything is missing
Please if someone can help with this


texts: Magento 2 - Customer group tier prices on Configurable products

texts:
I'm trying to add a different price for a customer group an a variation of a configurable product, but I cannot find out how it works. This is my situation:

I have a customer group named 'Retailer'
I have a configurable product with a color attribute (red, green)
I want to add a different price for Retailer customers on the green product

Is this even possible in Magento 2?


texts: Adding JS code Always showing below footer

texts:
I am inserting JotForm JS code in specific CMS Page but it always showing after footer. Even when I add jQuery CDN, it always showing after footer. I have tried head.phtml, header.phtml, CMS page editor and CMS page XML section but it still showing after footer.

1- [JotForm] <script type="text/javascript" src="https://form.jotform.com/jsform/90594783337166"></script>

  2-
  tech_support_inquiry

Any Suggestions?


texts: Not getting updated merge quote id using customer_login observer

texts: Using customer_login, not getting merge cart quote id . its provide new increment quote id. anyone know which one event use for get updated quote id after customer login.


texts: Magento integration test conflict with new customer eav attribute

texts:
I tried to run my integration test using

bin/magento dev:tests:run integration

but i always got an error like this:

Module 'Company_CutomerExtraAttribute':
Upgrading data...

[Magento\Framework\Exception\LocalizedException]
Invalid entity_type specified: customer

Exception trace:
() at /var/www/project/app/code/Magento/Eav/Model/Config.php:409
Magento\Eav\Model\Config->getEntityType() at /var/www/project/app/code/Company/CutomerExtraAttribute/Setup/UpgradeData.php:39

UpgradeData.php

<?php

namespace Company\CutomerExtraAttribute\Setup;

use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Customer\Model\Customer;
use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;

class UpgradeData implements  UpgradeDataInterface
{
    public function __construct(
        CustomerSetupFactory $customerSetupFactory,
        AttributeSetFactory $attributeSetFactory
    ) {
        $this->customerSetupFactory = $customerSetupFactory;
        $this->attributeSetFactory = $attributeSetFactory;
    }

    public function upgrade(ModuleDataSetupInterface $setup,
                            ModuleContextInterface $context){
        $setup->startSetup();
        if (version_compare($context->getVersion(), '1.0.2') < 0) {
          $insertArray = array(
            'id_card' => array("type" => "varchar", "label" => "Telephone"),
            'security_question_1' => array("type" => "int", "label" => "Security Question 1"),
            'security_question_2' => array("type" => "int", "label" => "Security Question 2"),
            'security_answer_1' => array("type" => "varchar", "label" => "Security Answer 1"),
            'security_answer_2' => array("type" => "varchar", "label" => "Security Answer 2")
          );

          foreach ($insertArray as $key => $data) {
            $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

            $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
            $attributeSetId = $customerEntity->getDefaultAttributeSetId();

            /** @var $attributeSet AttributeSet */
            $attributeSet = $this->attributeSetFactory->create();
            $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

            $customerSetup->addAttribute(Customer::ENTITY, $key, [
                'type' => $data['type'],
                'label' => $data['label'],
                'input' => 'text',
                'required' => false,
                'visible' => true,
                'user_defined' => true,
                'sort_order' => 1000,
                'position' => 1000,
                'system' => 0,
            ]);

            $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, $key)
            ->addData([
                'attribute_set_id' => $attributeSetId,
                'attribute_group_id' => $attributeGroupId,
                'used_in_forms' => ['adminhtml_customer'],
            ]);

            $attribute->save();
          }

        }
   }
}

I never have a conflict with this UpgradeData.php when i ran setup:upgrade, and the customer eav installed properly after i ran setup:upgrade


texts: Magento 2 file uploader not working in other theme in frontend

texts:
I am using magento inbuilt file uploader component in my theme, I have 5 types of different themes and have called uploader component from one of the custom module, the issue is I cannot see file Magento_Ui/templates/form/element/uploader/uploader.html loaded in console network in different theme, I can see it in main theme but not in any other theme, due to this issue, browse button is not displaying. Please find attached screenshots of my code

working theme

not working theme

code example

pleasse guide me what i am missing here?


texts: Price re-index causes DB deadlocks during checkout

texts:
I'm experiencing an issue where I believe the Product Price re-indexing process is causing a deadlock exception in the checkout process.

I caught this exception in the checkout process:

  Order conversion exception: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Unfortunately I don't have a full stack trace because of where the exception was caught, but checking the INNODB status I was able to track down the deadlock:

SELECT `si`.*, `p`.`type_id` FROM `cataloginventory_stock_item` AS `si`
INNER JOIN `catalog_product_entity` AS `p` ON p.entity_id=si.product_id
WHERE (stock_id=1)
AND (product_id IN(47447, 56678)) FOR UPDATE

*** (1) WAITING FOR THIS LOCK TO BE GRANTED:

RECORD LOCKS space id 0 page no 329624 n bits 352 index
`PRIMARY` of table `xxxx`.`catalog_product_entity`

The SQL requesting table lock is ultimately generated from  Mage_CatalogInventory_Model_Stock::registerProductsSale() when it is trying to get the current inventory count in order to decrement it.

At the time the deadlock occurred, the Product Price re-index process was running and I'm assuming it had a read lock on the catalog_product_entity table which caused the deadlock.  If I'm understanding the deadlock correctly any read lock will cause a deadlock, but the product price re-index holds the lock for a fair time as the site has ~50,000 products.

Unfortunately, by this point in the checkout code flow the customer's credit card had been charged (via a custom payment module), and the creation of the corresponding order object failed.

My questions are:

Is the custom payment module logic faulty? i.e. Is there an accepted flow for ensuring that Magento can convert the quote to an order exception free before committing the charge to the payment method (credit card)?

Edit:  It appears the payment module logic is indeed faulty as the call to $paymentmethod->authorize() should happen after the place where this deadlock occurs, not before (as per Ivan's answer below).  However, the transaction will still be blocked by the deadlock (albeit without the errant charge to the credit card).

This function call $stockInfo = $this->_getResource()->getProductsStock($this, array_keys($qtys), true); in Mage_CatalogInventory_Model_Stock::registerProductsSale() makes it a locking read, how dangerous would it be to make it a non-locking read?
In searching the web for an answer a couple of places suggested not running a full re-indexing while the site is hot; hardly seems like a good solution; is the issue of indexing causing table deadlocks and lock contention a known issue in Magento, are there workarounds?

Edit:  It seems the remaining question here is the one from the third question; re-indexing causing table deadlocks.  Looking for workarounds for this.

Edit: The concept that deadlocks aren't in and of themselves issues, but rather the response to them should be the focus, makes a lot of sense.  Investigating further to find a point in the code to catch the deadlock exception and reissue the request.  Doing this at the Zend Framework DB adapter level is one approach, but am also looking for a way to do this in the Magento code to ease maintainability.

There's an interesting patch in this thread: http://www.magentocommerce.com/boards/viewthread/31666/P0/ that seems to solve a related deadlock condition (but not this one specifically).

Edit: Apparently deadlocking has been addressed to a degree in CE 1.8 Alpha.  Still looking for a workaround until this version is out of Alpha


texts:
I FTP'd into my server with filezilla. I accidentally moved one theme into another. I have since moved it back but now its pulling in the footer from its parent theme, luma. Default.xml and Default Head Blocks.xml aren't working either.

I'm in developer mode.

Do I need to clear a folder?


texts: Get the number of the global messages to show

texts:
Before calling

$this->getMessagesBlock()->getGroupedHtml()

in my phtml templates file I would like to know if there are messages to show. I need something like this:

if($thereAreMessages) {
    echo '
';
    $this->getMessagesBlock()->getGroupedHtml()
    echo '
';
}

Is there a way to get this information?


texts: Add CSS class to body if the customer is logged in

texts:
I want to add a CSS class to the body when the customer is logged in or not. I thought this would work:

<body>
    <customer_logged_in>
        <attribute name="class" value="customer-logged-in"/>
    </customer_logged_in>
    <customer_logged_out>
        <attribute name="class" value="customer-logged-out"/>
    </customer_logged_out>

But that doesn't seem to work. Is there any way to do this via the layout?


texts: Adding a grouped product to cart via the rest api

texts:
I'm trying to POST a grouped product to my magento 2 site. Doing this for a simple product is easy enough. How to do it can be found here.

But what is doesn't specify is how to add a grouped product.
I have tried something like this:

POST rest/V1/carts/mine/items

{
"cartItem": {
    "sku": "arduino-kit-10000",
    "qty": "1",
    "quote_id": "5",
    "product_links": [
        {
            "sku": "arduino-kit-10000",
            "linked_product_sku": "13620748",
            "extension_attributes": [
                {
                    "qty": "5"
                }
            ]
        },
        {
            "sku": "arduino-kit-10000",
            "linked_product_sku": "1111111130",
            "extension_attributes": [
                {
                    "qty": "5"
                }
            ]
        }
    ]
}
}

But this gives me the following error:

   "message": "Property \"ProductLinks\" does not have accessor method \"getProductLinks\" in class \"Magento\\Quote\\Api\\Data\\CartItemInterface\".",

Does anyone know how this can be done?
Or if I can just add the simple products by themselves and let Magento know they belong to a grouped product?


texts: Get associated products of group in parts

texts:
I need to load associate products in parts/portions.

I am showing 3 products default. After that I have added a link ("load more"). Once the user clicks on "load more", the next 3 products should be added in the table.

Maybe this could be DONE by Offset but how can I do this? I don't understand.

I don't know how I can get associate products collection.

Please help if any one know how I divide associated collection in parts/portions.

Below is my code

        $product = Mage::getModel('catalog/product');
$product->load('157902');
         $associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product)->setCurPage(2)->setPageSize(2);

But collection is empty when I used offset , current page or page size


texts: How to get Estimated Tax on Shipping Method?

texts:
I Want to get Estimated Shipping Tax on Shipping Method without set shipping method on quote. Any one have idea?

Thanks in advance.

Any help would be appreciated!


texts: Send Tracking information email to customer when tracking number saved to Magento

texts:
Is there a way for Magento2 to send tracking information email to the customer when tracking information is saved?

Currently, we are using 3rd party tool ecomdash to process the order and shipment, and it use SOAP API to send back the tracking information to Magento 2, however, it does not notify the customer with email. Is there a way to trigger the "Send Tracking Information" when Magento received the tracking info?


texts: Magento has this db table: catalog_product_link_attribute. What is the purpose of this table. I researched some and it relates to associated products. Who has some examples to advanced use of this feature?


texts: Block type breaks when rewriting a block in custom module

texts:
Just installed Magento CE 1.9.3.1 into my local system.

Then I tried to override the default text input field of Varien class just to add "placeholder" attribute.

etc/config.xml of my module:

<?xml version="1.0"?>
<config>
    <modules>
        <Custom_PlaceholderAttribute>
            <version>1.0.0</version>
        </Custom_PlaceholderAttribute>
    </modules>
    <global>
        <blocks>
            <placeholderattr>
                <rewrite>
                    <text>Varien_Data_Form_Element_Text</text>
                </rewrite>
            </placeholderattr>
        </blocks>
    </global>
</config>

Block class file of module:

<?php
class Custom_PlaceholderAttribute_Block_Adminhtml_Text extends Varien_Data_Form_Element_Text {
    public function getHtmlAttributes() {
        $attributes = parent::getHtmlAttributes();
        $attributes[] = 'placeholder';
        return $attributes;
    }
}

Now when I try to change fieldset type, in any block-form file, by adding below line, it is giving me Fatal Error.

$fieldset->addType('text', Mage::getConfig()->getBlockClassName('placeholderattr/adminhtml_text'));

The Fatal error I am getting is:

Fatal error: Class 'Mage_Placeholderattr_Text_Block_Adminhtml_Text' not found in C:\UwAmp\www\testmage1931\lib\Varien\Data\Form\Abstract.php on line 146

But if I try this, rewrite works fine:

$fieldset->addType('text','Custom_PlaceholderAttribute_Block_Adminhtml_Text');

Why block type doesn't work in getBlockClassName(), can somebody clarify/explain the reason for this ?


texts: I want to rename a directory in magento and set the new refrence in the links

texts: I want to rename this sns_tornoto to some thing else how can i do that?


texts: Magento2: How to setup PWA Studio on website?

texts:
Why we should use PWA Studio?

How to setup PWA Studio on Magento community addition?

Please help in this


texts: Connect Manager fails to download with SSL handshake error

texts:
Today, my Magento Downloader won't work. It worked for installing extensions previously, but today I get: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure. It seems the issue is on Magento Connect, but I don't see other reports of the issue.

Magento 1.9.1


texts: Load Magento 2 static Block content in external website php file

texts:
I have a requirement like below.

There is a website which is running in production mode in one server.

That has some static blocks.

A block is created with some content(Ex:Block_Id: sample_block).

Here my question is I need to get the content of that block and load it in external PHP file, which is in different server.

Is this can be achieved in any way. please suggest me.


texts: Submit form to same page in custom module

texts:
I'm looking to submit my form to the same page, but it just redirects to the admin dashboard.

Here's my .phtml file:

<?php
    $action = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    if(isset($_POST['email_address'])){
        $email = $_POST['email_address'];
        echo $email;
    }
?>

Please enteer the customers email address and press reset. You will be given the customers new password after.

<form name="reset_password" method="POST" id="reset-password" autocomplete="off" action="<?php echo $block->getPostUrl(); ?>">

        <input type="email" name="email_address" placeholder="Enter email here..." class="admin__control-text" action"<?php echo $action; ?>" />

        <input type="submit"  class="action-secondary" value="Reset" />

</form>

How do I make the form submit to the same page without it redirecting? Thanks in advance.


texts: Add confirmation pop-up to admin form "Save" button

texts:
I have custom module which adds admin form. There is a button "Save" in the form container that saves the entire form and adds some data to the database.

I would like to avoid situation that user accidentally clicks the button.
How to add a javascript to the button that would display (on button click) a pop-up window with text like:

"Are you sure you want save? Yes/No"?

If user clicks "Yes", then the default action for the "Save" button will be triggered and form will be submitted. If user clicks "No" then nothing happens. This will prevent accidentally saving the form.

Is there anything like this available in magento admin forms? If not, how to add this feature to my form?

class Super_Awesome_Block_Adminhtml_Example_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
    public function __construct()
    {
        parent::__construct();

        $this->_blockGroup = 'awesome';
        $this->_controller = 'adminhtml_example';

        $this->_addButton(
            'my_button_save',
            array(
                'label' => Mage::helper('adminhtml')->__('Save'),
                'class' => 'save',
            ),
            100
        );
    }
}


texts: Magento2.3.4 - No such entity with customerId

texts:
I imported all my Customers from my Old Magento store.
But now, when a Customer try to log in in my new store with a wrong password, they can see this error:

Can someone tell me how I can fix it please?
Many thanks


texts: What is wrong with my Cpanel cronjob configuration?

texts:
My catalog rules are being reset and I know that this is a cron problem.

Here is what my cron config looks like on my Cpanel:

What is wrong with this? Do I need to do something else to get cron to work?

The server is a dedicated one.


texts:
I am new to magento 2 and i am trying to figure out what i am doing wrong when trying to make a custome layout for the homepage.

I have the following structure

let $themPath = app/design/frontend/VendorName/themeName

In $themPath/layouts.xml i added the following:

<layout id="my-home">
    <label translate="true">my-home</label>
</layout>

I added $themPath/Magento_Theme/page_layouts/my-home.xml with the content copied from 1column.xml. No changes

I ran

1) rm -rf var/
2) rm -rf pub/static/frontend/VendorName/*
3) bin/mangento setup:upgrade
4) bin/magento cache:clean

After i reload the admin interface, go to content->Pages, edit homepage and i still don't see the my-home layout available in the dropdown for homepage

What am i doing wrong ?


texts: Magento 2 - delete product in shopping cart view - blank page

texts:
when we delete a product in the shopping cart (checkout/cart/index/) view via the button "Remove item", I always get a blank page at the checkout/cart/delete/ page.

Does anyone know how to fix this?

We are using Magento 2.3.3 - here simply as guest user, not logged in, but for logged in users same happens.

I´d be grateful for any hint.


texts: Extension attributes showing null value in in Magento 2

texts:
I have created one custom field in Magento 2 payment table through install schema and want to add getter and setter to the Magento\Quote\Api\Data\PaymentInterface to set and add data.

extension_attributes.xml

<extension_attributes for="Magento\Quote\Api\Data\PaymentInterface">
    <attribute code="policy_no" type="string"/>
</extension_attributes>

  When i want to retrieve that value through below code i am getting
  null.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $paymentInformation = $objectManager->create('Magento\Quote\Api\Data\PaymentInterface');
        $extAttributes = $paymentInformation->getExtensionAttributes();
        var_dump($extAttributes);exit;


texts: Magento - Send Order PDF with an addition attribute to a defined email

texts: I need to set an automatic email that notify the only one supplier that I've, that I receive an order, so they can start to produce it. I need so to send an attached pdf with an additional attribute, our internal code, that customer haven't to see in the pdf that him receive. For modify pdf, I'm trying myself, but I don't know how to make the automatic email with different pdf.. Can you help me pls? Thank you!


texts: How can I Add My Attribute in Filter Navigation?

texts:
If you look at the Price Filter in Category. As Price in Not Drop Down Attribute, it's Catalog Input Type for Store Owner as Price & In Admin it dosen't have Drop Down Values.

Now I have added my Attribute named "Promotion" which is a Text Field. I'm not able to add that as a Filter Navigation.

So people can Filter Data with my Newly create Attribute. How to solve this?

I have already Clean the Cache & Indexing also. I would like to show my Promotion Field in Filter Navigation.

In "Attribute Properties" if i select "Catalog Input Type for Store Owner" as "DropDown", then only it works.

Lastly, have to manage through Database.


texts:
I am new to magento

I am working on product import

i have migrated my site from one domain to another but after that while importing product in my site i am getting error

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`choiccgo_shop`.`cataloginventory_stock_item`, CONSTRAINT `FK_CATINV_STOCK_ITEM_STOCK_ID_CATINV_STOCK_STOCK_ID` FOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DEL)

I am stuch tried everything but no success.


texts: Magento 2 add custom tab to account dashboard

texts:
I want to add a custom tab on account dashboard in Magento2 and I have seen many tutorials for creating new module but not one showing exact location for placing that module.

Right now I have placed my custom module on this path app/code folder but it is not working.

I have followed this tutorial for creating a new module,

https://magecomp.com/blog/add-custom-tab-in-customer-account-section-magento-2/#comment-5094

Anyone can help to know the exact location for placing module.


texts:
IT`s a fresh Magento 2.1 files

Initially all working fine , but after some time its  giving this error

[Zend_Db_Adapter_Exception]
  pdo_mysql extension is not installed
 cache:clean [--bootstrap="..."] [types1] ... [typesN]

As per localhost/dashboard/phpinfo.php I am using PHP Version 5.6.30

maddy@maddy:/opt/lampp$ sudo apt-get install pdo-mysql php5.0-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pdo-mysql
E: Unable to locate package php5.0-mysql
E: Couldn't find any package by glob 'php5.0-mysql'
E: Couldn't find any package by regex 'php5.0-mysql'
maddy@maddy:/opt/lampp$
   **Even below command don`t work**
maddy@maddy:/opt/lampp$ sudo apt-get install pdo-mysql php7.0-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pdo-mysql

I checked the availability

maddy@maddy:~$ sudo phpenmod pdo_mysql
[sudo] password for maddy:
WARNING: Module pdo_mysql ini file doesn't exist under /etc/php/7.0/mods-available


texts: I want to show currency symbol and price in different html tag.

texts:
My Requirement is

To fullfill that requirement i have put this code in app/design/frontend/<theme>/default/template/catalog/product/list.phtml

            <?php
             $currency_symbol = Mage::app()->getLocale()->currency( $currency_code )->getSymbol();
             $specialprice_col = number_format($_product->getSpecialPrice(),2);
             ?>

                <?php echo $currency_symbol; ?><?php echo number_format($_product->getPrice(),2); ?>

but when i put this code it is working perfect in simple product but in bundle product the price shows $0 instead of my setted price.


texts: Change VAT Number in a invoice in a placed order

texts:
I've a client who wants change the VAT Number in the invoice, but when i change it in the order at the billing section when i print the pdf for the invoice the VAT Number is the old.

How can i change this problem?

Regards.


texts:
I was attempting to customize Magento's 503 and Maintenance error pages (404 is set up and works fine), but Magento can't load the stylesheets for the error pages.

If I put Magento in maintenance mode, or force some kind of DB error, it does load the appropriate page, but when it attempts to load css/styles.css that page, too, returns the error page instead if the css file.

How can I fix this?

Edit:

My folder structure, as requested

errors/
errors/404.php
errors/503.php
errors/design.xml
errors/local.xml
errors/processor.php
errors/report.php
errors/default/
errors/default/404.phtml
errors/default/503.phtml
errors/default/page.phtml
errors/default/report.phtml
errors/default/css/styles.css
errors/default/images/

I use maintenance.flag to force Magento to give me an error page. It tries to load http://localhost/css/styles.css but that returns a 503, so I get an unstyled error page.

If I access http://localhost/errors/default/css/styles.css I get the Magento error page, but it is styled (its able to load stylesheets). Loading any random url starting with the path http://localhost/errors/default/ loads the error page correctly, so it seems to have something to do with how magento is building the error pages...


texts: Images ( PNG or JPEG ) file size increased when uploaded through wysiwyg editor

texts: I have both optimized PNG and JPEG images that I want to upload in wysiwyg but everytime I check it in frontend after upload and save it to my computer, the file size changes to triple of the original file size. I tried changing imagejpeg($img, $filePath, 100); to imagejpeg($img, $filePath); from mage/core file but nothing happens. How can I solve this?


texts: Why my module is not working?Am i following the right way?

texts:
Ok so i got an answer to my question about AUTO turning on the Stock Availability status to 'In Stock' (from 'Out of Stock') after we increase quantity from 0. The answer was to try this module below,but its not working for me.could you please tell if i am placing the files right way?

My Module Namespace : Apollo
Module Name: Proaval

I have set all these directories:

App/Code/Local/Apollo/Proaval/Block
App/Code/Local/Apollo/Proaval/controllers
App/Code/Local/Apollo/Proaval/etc
App/Code/Local/Apollo/Proaval/Helper
App/Code/Local/Apollo/Proaval/Model
App/Code/Local/Apollo/Proaval/sql

My Apollo_Proaval.xml is in App/etc/modules, which has the following code:

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

Next, please check my config.xml in app/code/local/Apollo/Proaval/etc/config.xml

    <?xml version="1.0"?>
    <config>
<global>
     <events>
    <catalog_product_save_after>
            <observers>
                <Save_product_data>
                    <type>singleton</type>
                    <class>Magetest_test_Model_Observer</class>
                    <method>changeStockStatus</method>
                </Save_product_data>
            </observers>
    </catalog_product_save_after>
</events>
      </global>
    </config>

And finally here is the Oberver.php located in app/code/local/Apollo/Proaval/Observer.php

    <?php
    public function changeStockStatus($observer) {
        $product = $observer->getProduct();
        $stockData = $product->getStockData();

        if ( $product && $stockData['qty'] > 0) {
            $stock =   Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getEntityId()); // Load the stock for this product
    $stock->setData('is_in_stock', 1); // Set the Product to InStock
    $stock->save(); // Save
}
    }

What i am suspecting is there is perhaps something wrong with config.xml?Please check it once.


texts: Magento 1.9 - Change color or email templates

texts:
Im trying to change the color of the standard email templates. I have:

Magento 1.9
Set custom skin to my custom theme
Moved email-inline.scss and email-non-inline1.scss into my custom theme

All I am looking to do is change the background color from grey to white. No matter what i change on both those style sheets, the color does not change. I have even made the changes in the RWD folder, to make sure its not a themeing issue, and the color is still not changing. What i am doing wrong? How can you change the background color of these email templates from grey to white?

thanks !


texts: How to create new order states in magento 2

texts: "processing", "complete", "new" are examples of the default Magento order state codes. but how to create custom order state


texts: Magento 2.1.3 - Import products. Issue with categories

texts:
When I'm trying import eg 2 products:

I have no error with Check Data but on import:

Category "MAN/zakiet/zakiet" has not been created. URL key for specified store already exists. in row(s): 2

and category looks like :

There is no problem for create those categories manually, but:

It is Magento issue, right?
Is it possible to fix it quickly?

EDIT:
I also tried use :

Default Category/WOMEN/zakiet/zakiet
Default Category/MAN/zakiet/zakiet

in csv as categories.
Result:

Category "Default Category/WOMEN/zakiet/zakiet" has not been created. URL key for specified store already exists. in row(s): 1, 2

Categories:

EDIT:
It happens when You try create similar categories in other root category. It happens because firs category won't be include in url rewrites. Eg:
First Default Category -> Test1 -> Test2
create paths:
/test1.html and /test1/test2.html
When You try to create :
Second Default Category -> Test1 -> Test2 Magento will create rewrite with paths:
/test1.html and /test1/test2.html also.
SOLVE:
Try to set different url category or use one root category.


texts: How to update value of custom customer attribute (image) from frontend in magento 2

texts:
Trying to update custom customer attribute value while customer edit from frontend , and my field is file upload control but unable to save the attribute
Tried
$customer = $observer->getEvent()->getCustomer();
$customer->setCustomAttribute('profileimage', '123.jpg');
$this->customerRepository->save($customer);

but getting error Call to a member function setCustomAttribute() on null
secondly, I have also try
$event = $observer->getEvent();
$customer = $observer->getCustomerDataObject();
$customerId = $customer->getId();
$customerData = $this->_customerRepositoryInterface->getById($customerId);
$customerData->setCustomAttribute('profileimage', '123.jpg');
$customer->updateData($customerData);
$customerResource = $this->customerFactory->create();
$customerResource->saveAttribute($customer, 'profileimage');

Still getting error for updateData() function not found.
can anyone help me out to save custom customer attribute from frontend for image in Magento 2.


texts: how to capture braintree using customer token in magento2

texts:
I enabled vault feature in Braintree.In frontend by default customer should store their credit card(force fully) at checkout.

For example, the customer places an order value with $100.

Now I captured amount by generating an invoice with capture online.

Now I want to capture $15 extra amount using customer Token.
Can you help me how to do programmatically?
Below code using txn_id but I need capture through the token.

Client will share order increment Id, Extra Amount to Capture in CSV file.
So using Order Increment Id I can get order id, order payment id.

1.how to get token associated to payment id?

2.How to charge extra amount using that token?

 \Magento\Braintree\Model\Adapter\BraintreeAdapter $brainTreeAdapter
    $result = $this->brainTreeAdapter->submitForSettlement($txnId, $amount);


texts: Managing translations on CMS pages, blocks and strings on a Magento store as of 2021

texts:
After almost a decade staying away from it, I'm back on Magento development. I can see the platform has evolved quite a bit since then, but on the translation management side my feeling is that it lags behind other competing platforms like the Wordpress + WPML combo:

First of all, I'm not quite comfortable with managing translation CSV files by hand, since people with non IT backgrounds are also involved on the project, I will become a bottleneck for sure.

Second, the only way I'm aware of managing multi lingual CMS pages and blocks is to duplicate them for each store view and translate each duplicate. I'm aware that {{ trans }} tags can be used on CMS pages and blocks, but then I have to maintain CSV files for these translations by hand, since there doesn't seem to be an official way of automatically scanning translations on contents.

My employer has also plans to migrate to Magento Commerce Cloud in the future, since the visual page builder in this edition looks promising in order to build complex layouts, compared to the TinyMCE editor on the community version.

Before posting this question I did a little bit of research and I came accross these options:

Magento 2 Bulk Translation Manager:
https://modernmodules.com/plugins/magento-2-bulk-translation-manager/
Looks interesting for it's feature that allows scanning for {{ trans }} tags inside CMS pages and blocks, and later export/import these through CSV files.

Weglot:
https://weglot.com/integrations/translate-magento-store/
In terms of ease of use and integration procedure looks very good. What I dislike is that looks like a cloud solution, where translated content is delivered by Weglot's servers. This will also become less convenient in the future when we migrate to Magento Commerce Cloud, which is hosted by Adobe.

Is there any other solution or third party module that could help manage translations on both templates and CMS contents?


texts:
I use magmi to import products from external sites which is working and has done for many years.

The problem is that for some reason new products have stopped showing in the Magento admin panel.

I can see up to id 635,533 but nothing above that.

The products are in the database and the import works as expected.

If I change the edit URL like so...
/catalog_product/edit/id/63539/

I can see the edit view of this product.

If I make changes it shows as a success reloads the page but the changes aren't updated.

Did anyone hear of this before?


texts:
In magento 1.9, whenever I save any configurable product  in admin panel, all the product urls goes to 404 unless I do reindexing.

In reindexing there are 8 processes, 7 of which works fine but the 8th one Vendor Product Url Rewrite get stuck with

  Reindexing Required

And the error I get is

  Request Path for Specified Store already exists during Indexing

This error also gets fixed once I empty the table "core url rewrite" and reindex it.

Note: I have using VES vendor extension which is creating "Vendor Product Url Rewrite" process for indexing.

Can Anyone help me with this situation?


texts: Can we trust on backup tools Which is provided by Magento 2?

texts:
I want to take daily basic backup of database and Website. So Can I trust Magento inbuilt tools? Here is the path

  System->Tools->Backups

what are the possible reasons behind it to not take backup using Magento?


texts: Magento 2.3.1 authorizenet-acceptjs does not support partial refunds

texts:
After upgrading from 2.2.7 -> 2.3.1, we have successfully switched from deprecated authorize.net MD5 based hash direct post to SHA-512 signature key method.
The issue with new authorizenet module is now we'r not able to create partial refunds.
Looking and comparing with old module, I found vendor/magento/module-authorizenet/Model/Directpost.php:68 has protected $_canRefundInvoicePartial = true;
Question, what would be a proper way to extend new authorizenet module, to support partial refunds.

Thank you.


texts: Gruntfile.js, Autoprefixer and bin/magento setup:static-content:deploy

texts:
The vanilla checkout of Magento2 contains a Grunt boilerplate including the autoprefixer task. It works all sweet and dandy (according to our frontend devs).

However now as I need to make the whole application working in deployment, we're not using Grunt but the the given Magento bin command with the setup:static-content:deploy action (php -f bin/magento -- setup:static-content:deploy).

But there somehow the autoprefixer looks lost. Now I'm puzzled which configuration point I was missing or is it so that the Grunt example is not-so-related to actual bare work that has to be done shipping the Magento2 application?


texts:
I am doing save data to database. But i have three form in here

But when i submit. The data received only one final form

This is my code
 public function execute()
 {
     $resultRedirect = $this->resultRedirectFactory->create();
     $courseCollecton = $this->_courseFactory->create();
     $data = (array) $this->getRequest()->getPost();
    var_dump($data);exit;
    $courseCollecton->addData($data);
    $courseCollecton->save();
    $resultRedirect->setUrl('/helloworld/index/knockout');
    return $resultRedirect;
    }

In my file html
<form action="/helloworld/index/KnockoutSave" method="POST">

 0">

        Course Name: <input data-bind="value: courseName" name="name"/>
        Number of participants: <input data-bind="value: numberOfParticipant" name="number_of_participants"/>
        Details information: <input data-bind="value: detailsInformation" name="details_information"/>
        <button data-bind="click: $parent.removeCourse.bind($parent)">Delete</button>

<button type="submit">Save Course</button>
</form>

Please help me!


texts: Magento2: How to remove the newsletter block?

texts:
I have newsletter signup block on my front page that I want to remove. However I can't seem to find it anywhere.  With development mode I can see that it is being rendered from app/design/frontend/TemplateMonster/Spiceli/Magento_Newsletter/templates/subscribe.phtml
and that it is Magento\Newsletter\Block\Subscribe from this two information is there a way to can remove it?


texts: Shopping Cart Price Rule - cart totals equal to or greater than w/ a equal to or less than subtotal

texts:
I'm attempting to create a shopping cart price rule with custom discounts based on cart subtotal.
E.g.
Less than $10k = 2%
Between $10k and $25k = 3%
Between $25k and $35k = 4%
Greater than $35k = 5%

Example for 3% rule:
Adding the subtotal condition below does not work.

Any guidance would be most appreciated.
Thanks