texts:
On my website, I want to remove the 'Starting at:' string in front of the price, only when the product has a certain category.

I am now searching in template/catalog/product/price.phtml, and found this code:

<?php if ($showMinPrice): ?>
  <?php echo $this->__('Starting at:') ?>
<?php endif ?>

Which most likely displays the text. Problem is, when I do changes to these div's, even adding classes or whatever, it does nothing. Is there maybe another place where the 'Starting at:' text is loaded in?

Progress so far:

Via template hints, I saw that the problem is existing in the price.phtml file, not a suprise
I tried to remove the code above, but it still displays the string
Also tried flushing the cache (even when it's disabled) and even reindexing, did not work


texts:
I have created product level attribute with the type text field.

Now I am facing issue because complete value not coming.

How we can update the Catalog Input Type for Store Owner text field to the text area in magento2?


texts: Magento 2: What is Purpose of .travis.yml file?

texts:
In Magento 2 CE Version 2.1.0. I have below content in .travis.yml

sudo: required
dist: trusty
addons:
  apt:
    packages:
    - mysql-server-5.6
    - mysql-client-core-5.6
    - mysql-client-5.6
    - postfix
language: php
php:
  - 5.6
  - 7.0
env:
  global:
    - COMPOSER_BIN_DIR=~/bin
    - INTEGRATION_SETS=3
  matrix:
    - TEST_SUITE=unit
    - TEST_SUITE=integration INTEGRATION_INDEX=1
    - TEST_SUITE=integration INTEGRATION_INDEX=2
    - TEST_SUITE=integration INTEGRATION_INDEX=3
    - TEST_SUITE=static
cache:
  apt: true
  directories: $HOME/.composer/cache
matrix:
  exclude:
    - php: 7.0
      env: TEST_SUITE=static
before_install: ./dev/travis/before_install.sh
install: composer install --no-interaction --prefer-dist
before_script: ./dev/travis/before_script.sh
script:
  - cd dev/tests/$TEST_SUITE
  - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
  - phpunit $TEST_FILTER

What is exact purpose of this? What it does? May be used for testing?


texts: Magento 2 Sales Order Grid Mass Action Sort Order

texts:
I am trying to sort the Mass Action menu in the sales order grid, I have added <item name="sortOrder" xsi:type="number">600</item> to the sales_order_grid.xml but it has no affect.

Is it still possible in version 2.3.2 to sort the menu?

This is what I have so far

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
    <massaction name="listing_massaction">
        <action name="add_to_archive">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">add_to_archive</item>
                    <item name="label" xsi:type="string" translate="true">Add To Archive</item>
                    <item name="url" xsi:type="url" path="massAddToArchive"/>
                    <item name="sortOrder" xsi:type="number">600</item>
                </item>
            </argument>
        </action>
    </massaction>
    <paging name="listing_paging"/>
</listingToolbar>


texts: How do I add a Buy from Amazon button in Magento2?

texts: I tried to research online but didn't really find an answer. I am totally new in coding and it'll be really helpful if you can make the answer in detail.


texts:
*/1 * * * * www-data php /var/www/magento-2/bin/magento cron:run
*/1 * * * * www-data php /var/www/magento-2/update/cron.php
*/1 * * * * www-data php /var/www/magento-2/bin/magento setup:cron:run

this is cron job setting and my crontab.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
  <group id="default">
    <job name="send_call" instance="Custom\Module\Model\Observer\Event" method="sendEmail">
      <schedule>*/5 * * * *</schedule>
    </job>
  </group>
</config>

I check many times but cron not working


texts: Magento 2.0 vs 2.1 - which is better to use right now?

texts:
I am currently doing development on Magento 2.0.4 and i need to deploy my site in 1 month.

So the question is:

Is it better to keep using Magento 2.0 or should i move to 2.1.?
also Magento 2.1 has admin structure changes that I'll have to do as well, like admin tabs are removed from 2.1 etc.


texts: How to get Base Url in Checkout Html FIle in Magento 2?

texts:
I have create a new step in checkout form Magento 2.
I want to get base Url in my .html file like http://127.0.0.1/magento How will i get that?
Any help is appreciated.


texts: Magento: How to get customer last order by joining customers and orders?

texts:
I am trying to get the customers last order id and customer related data on frontend in a block.

Basically I will have a parent customer who will connect to its child customers with an ERP Customer ID (which I saved as an attribute). I want to load all those child customers and need to fetch their data along with last order id.

Below is what I have done so far (Edit code):

$currentCustomer = Mage::getSingleton('customer/session')->getCustomer();
$customers = Mage::getResourceModel('customer/customer_collection')
    ->addNameToSelect()
    ->addAttributeToSelect('entity_id')
    ->addAttributeToSelect('email')
    ->addAttributeToFilter('billing_customer', $currentCustomer->externalERPIdId())
    ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
    ->joinTable(
        array('order' => 'sales_flat_order'), 'customer_email = email',
        array('order_id' => 'order.entity_id', 'createdAt' => 'order.created_at'),
        null,
        'left'
    )
    ->groupByAttribute('entity_id');

Although I do get some customer data along with the orders id but I do not know how to filter the above collection so that I only get customer_id, customer name, email, LAST order id. Also the ORDER BY condition is not applying to query.

Here is the final query (EDIT):

SELECT `e`.*, `at_prefix`.`value` AS `prefix`, `at_firstname`.`value` AS `firstname`, `at_middlename`.`value` AS `middlename`, `at_lastname`.`value` AS `lastname`, `at_suffix`.`value` AS `suffix`, CONCAT(IF(at_prefix.value IS NOT NULL AND at_prefix.value != '', CONCAT(LTRIM(RTRIM(at_prefix.value)), ' '), ''), LTRIM(RTRIM(at_firstname.value)), ' ', IF(at_middlename.value IS NOT NULL AND at_middlename.value != '', CONCAT(LTRIM(RTRIM(at_middlename.value)), ' '), ''), LTRIM(RTRIM(at_lastname.value)), IF(at_suffix.value IS NOT NULL AND at_suffix.value != '', CONCAT(' ', LTRIM(RTRIM(at_suffix.value))), '')) AS `name`, `at_billing_customer`.`value` AS `billing_customer`, `at_default_billing`.`value` AS `default_billing`, `at_billing_telephone`.`value` AS `billing_telephone`, `order`.`entity_id` AS `order_id`, `order`.`created_at` AS `createdAt` FROM `customer_entity` AS `e`
LEFT JOIN `customer_entity_varchar` AS `at_prefix`ON (`at_prefix`.`entity_id` = `e`.`entity_id`) AND (`at_prefix`.`attribute_id` = '4')
LEFT JOIN `customer_entity_varchar` AS `at_firstname` ON (`at_firstname`.`entity_id` = `e`.`entity_id`) AND (`at_firstname`.`attribute_id` = '5')
LEFT JOIN `customer_entity_varchar` AS `at_middlename` ON (`at_middlename`.`entity_id` = `e`.`entity_id`) AND (`at_middlename`.`attribute_id` = '6')
LEFT JOIN `customer_entity_varchar` AS `at_lastname` ON (`at_lastname`.`entity_id` = `e`.`entity_id`) AND (`at_lastname`.`attribute_id` = '7')
LEFT JOIN `customer_entity_varchar` AS `at_suffix` ON (`at_suffix`.`entity_id` = `e`.`entity_id`) AND (`at_suffix`.`attribute_id` = '8')
INNER JOIN `customer_entity_int` AS `at_billing_customer` ON (`at_billing_customer`.`entity_id` = `e`.`entity_id`) AND (`at_billing_customer`.`attribute_id` = '213')
LEFT JOIN `customer_entity_int` AS `at_default_billing` ON (`at_default_billing`.`entity_id` = `e`.`entity_id`) AND (`at_default_billing`.`attribute_id` = '13')
LEFT JOIN `customer_address_entity_varchar` AS `at_billing_telephone` ON (`at_billing_telephone`.`entity_id` = `at_default_billing`.`value`) AND (`at_billing_telephone`.`attribute_id` = '31')
LEFT JOIN `sales_flat_order` AS `order` ON (order.customer_email =e.email) WHERE (`e`.`entity_type_id` = '1') AND (at_billing_customer.value = '1006') GROUP BY `e`.`entity_id`

Adding the GROUP BY clause saved me from the duplication error but on the other end it does not give me the last/latest Order_id of the user.

It would be nice if someone can tell me what I need to change in the collection or join query to get the required result?


texts: jQuery autocomplete select box - must press “Enter” Key

texts:
There is a problem with my select box which shows them a list when they start typing, and they have to click on their city or type it correctly.

When I click on a city from the list, the matching shipping methods won't show up untill I'll press "Enter" on the box or click outside of it.

I want that the shipping methods will show up just when the client chose his city. without clicking the enter key or outside of the box.

Here is the script:

<script>
jQuery(function() {var availableTags = ["A","B","C","D"];

    function addOption(newvalue){
      if (newvalue!==''){
        // assign an id of 0 so that we know to insert into the database
        var newelement = {id:0,label:newvalue};
        availableTags.push(newelement);
        showAvailableTags();
      }
    }

    function showAvailableTags(){
      jQuery(".my-billing-city").autocomplete({
        source: availableTags,
        select: function( event, ui ) {
          // get label input box
          var $label = jQuery(this);
          $label.val( ui.item.label );
          // get hidden id box
          var $id = jQuery('#'+this.id.replace('label_','id_'));
          $id.val( ui.item.id );
          return false;
        },
        change: function( event, ui ) {
          var $label = jQuery(this);
          // figure out the id of hidden input box from label id
          var $id = jQuery('#'+this.id.replace('label_','id_'));
          if ( ui.item === null && $label.val() != '' ){
            // new value so ask user if they want to add it
            var add =             alert( "You must choose a city from the list!" );
            if (add){
              $id.val(0);
              addOption($label.val());
            }
            else{
              // not added so clear input box
              $label.val('');
              $id.val('');
            }
          }
        }
      });
    }

    // bind tags to for autocomplete
    showAvailableTags();
});

jQuery( ".ui-autocomplete .ui-menu-item" ).click(function() {
    alert( "Handler for .click() called." );
});
</script>


texts: Dataflow - Profiles : How to check failed products in import all product

texts:
I have created CSV file and run profile. Some products failed due to image not found issue. I want to find out which products have failed in the process.
Are there anyway to echo sku for failed products?
Do these kind of errors log in the system?

EDIT

I could find a way to find failed products using firebug. But it's not a good solution for this. Is there anyone know to check this, highly appreciate.

Thanks


texts: Magento 2: I need to run observer in crontab.xml. But it is not working

texts:
I am running observer in crontab.xml. This is not working.

Here is my code

    <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="abandon_cron_run" instance="Abc\Abandon\Observer\Abandon" method="execute">
            <schedule>* * * * *</schedule>
        </job>
    </group>
</config>

Abandon.php

namespace Abc\Abandon\Observer;

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

class Abandon  implements ObserverInterface
{

    protected $scopeConfig;

    public function __construct(

        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig

    )
    {
      $this->scopeConfig = $scopeConfig;
    }

    public function execute(Observer $observer)
    {

            $productName=array();
            $productNames='';
             $itemsArray = $observer->getCart()->getQuote()->getItems();
            foreach($itemsArray as $item) {
                $productName[] = $item->getName();
            }
                 if(is_array($productName)){
                    $productNames .= implode(';',$productName);
                }

                $abdata['productNames'] = $productNames;
            return $abdata;
    }
}


texts: pass custom variable/parameter from email template to phtml file

texts:
I am stuck in my custom code.

I want to pass a custom variable from email template to pthml file.

Edit file

  app/code/local/Mage/Sales/Model/Order.php

in this function :

public function sendNewOrderEmail()
  {

--- default code start ----
$mailer->setTemplateParams(array(
                'order'        => $this,
                'test'        => 'XXXXX',
                'billing'      => $this->getBillingAddress(),
                'payment_html' => $paymentBlockHtml
            )
        );
--- default code end ----
}

and then I put this code in New Order email template:

{{layout handle="sales_email_order_items" order=$order  test=$test}}

template file located here :

  app/locale/en_US/template/email/sales/order_new.html

and I am trying to get test variable Here:

  app/design/frontend/default/default/template/email/order/items/order/default.phtml

like this: $test = $this->getItem()->getTest()

but get success. Please let me know where am I wrong? or what to do need to access this variable in phtml file?

Thanks in advance!


texts: Magento2 :Change the object maganer to constructor

texts:
Can anyone help me how to change the object manager to a constructor in magento2:

$om = \Magento\Framework\App\ObjectManager::getInstance();
            $customerSession = $om->get('Magento\Customer\Model\Session');
            $customerData = $customerSession->getCustomer()->getData();
            $customerId = $customerSession->getCustomerId();
            $customerObj = $om->create('Magento\Customer\Model\Customer')
                ->load($customerId);
            $customerData = $customerObj->getDataModel();
    try {
                    $customerData->setCustomAttribute('r_what_percent_of_the_pharmacy', $r_what_percent_of_the_pharmacy);
                    $customerData->setCustomAttribute('r_what_percent_of_prescrip', $r_what_percent_of_prescrip);
                    $customerData->setCustomAttribute('r_how_many_total_prescriptions', $r_how_many_total_prescriptions);
                    $customerData->setCustomAttribute('r_has_the_owner_or_pharmacy', $r_has_the_owner_or_pharmacy);
                    $customerData->setCustomAttribute('r_does_the_pharmacy_solicit', $r_does_the_pharmacy_solicit);
                    $customerData->setCustomAttribute('r_is_your_clinic_or_pharmacy', $r_is_your_clinic_or_pharmacy);
                    $customerData->setCustomAttribute('r_are_one_or_more_practiti', $r_are_one_or_more_practiti);
                    $customerData->setCustomAttribute('r_does_the_pharmacy_offer', $r_does_the_pharmacy_offer);
                    $customerData->setCustomAttribute('r_any_exceptions', $r_any_exceptions);
                    $customerData->setCustomAttribute('r_any_exceptions_circumstances', $r_any_exceptions_circumstances);
                    $customerData->setCustomAttribute('r_does_the_pharmacy_clinic', $r_does_the_pharmacy_clinic);
                    $customerData->setCustomAttribute('r_currentstep', $r_currentstep);
                    $customerObj->updateData($customerData);
                    $customerObj->save();
                } catch (Exception $e) {
                    return $e->getMessage();
                }


texts: Magento 2 Change the email address of store when customer places order

texts: how to change the email address where we get the email when an order is placed on our magento 2. I want to add the multiple email address where email should be sent.


texts: How I can show 'My orders' in MY Dashboard?

texts:
I want to show my all orders list in my dashboard .with this wishlist page. I think its in luma by default but I am using a theme so where in xml I have to again activate this ? .

customer_account_index.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <body>
        <referenceBlock name="page.main.title">
            <action method="setPageTitle">
                <argument translate="true" name="title" xsi:type="string">My Dashboard</argument>
            </action>
        </referenceBlock>
        <referenceContainer name="content">
            <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="account/dashboard/info.phtml" cacheable="false"/>
            <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="account/dashboard/address.phtml" cacheable="false"/>
            <block class="Magento\Framework\View\Element\Template" name="customer_account_dashboard_top" as="top"/>
        </referenceContainer>
    </body>
</page>


texts: Magento E-Commerce website only without using the backend admin panel

texts: I want to integrate the e-commerce website of Magento with one of my custom ERP solutions. My custom ERP provides APIs to integrate with it. My question is, whether it is possible to deploy only the e-commerce site of the magneto and integrate it with my ERP OR it is mandatory to set up the admin panel of Magento also?


texts: Magento 2 : How to get Final price & Original price of all types of product

texts:
How can I get Original price and Final price of given below types product?

Simple product
Configurable product
Bundle product
Group product

For simple product I can get price easily using below code.

$finalPrice = $product->getFinalPrice();
$originalPrice = $product->getPrice();

But I am not able to get Original price and Final price for Configurable product, Bundle product, Group product

Is there any easy way to get both prices of all other types of product.

EDIT :

I get price Original price and Final price of configurable product using below code. and take reference from get-price-range-configurable-product-magento-2

$basePrice = $product->getPriceInfo()->getPrice('regular_price');

$regularPrice = $basePrice->getMinRegularAmount()->getValue();
$specialPrice = $product->getFinalPrice();

Any help would be appreciated! Thanks.


texts:
As the title says. I don't want the ID of the current website, I want the ID of any website by supplying only that websites name.

I have this code:

$siteModel = Mage::getResourceModel( 'core/website_collection' )->addFieldToFilter( 'name', $site )->getFirstItem();
$siteId = $siteModel->getId();

But $siteId ends up empty.

If all i have the name of a website, then how can i get its ids?


texts:
I was able to start migration tool between 1.9.0.1 and 2,2 but it did not complete due to mismatch of data.

When i logged in to M2 backend, css was gone and i just had a white background with the links. Frontend was working.

I did reindex and clean the cache but had a 'no such entity" message.
On the exception.log i can see this error:

On the websiteRepository.php I see this block:

public function getById($id)
    {
        if (isset($this->entitiesById[$id])) {
            return $this->entitiesById[$id];
        }

    $websiteData = $this->getAppConfig()->get('scopes', "websites/$id", []);
    $website = $this->factory->create([
        'data' => $websiteData
    ]);

    if ($website->getId() === null) {
        throw new NoSuchEntityException();
    }
    $this->entities[$website->getCode()] = $website;
    $this->entitiesById[$id] = $website;
    return $website;
}

Line 102 is:  throw new NoSuchEntityException();

Now I cannot access frontend or backend,I just have a blank page.

Is there any way to fix this?

Thanks!

Emilie


texts: Change Magento 2.3.1 image upload dimensions

texts: I changed the MAX_IMAGE_WIDTH and MAX_IMAGE_HEIGHT constants of image uploader in file vendor/magento/framework/File/Uploader.php. But doesn't seem to work. Original image dimension changes. Where else should I change?


texts:
Why im facing upgrade error issue all of a sudden.

Im getting as below:

1) I run php bin/magento setup:upgrade command

2) cleared all cache

3) run php bin/magento setup:static-content:deploy

4) Gave full write permission to my project folder.

Post all these, still im getting the same error in screen.


texts: I'm running a shoe store, so I have lots of attributes creating a lot of different indexable URLS's (shoe sizes, colours etc) - Should I submit all of these url's? Will it bring an SEO benefit or not


texts:
I have 3 stores on my Magento installation.
Each site has its own footer, with content coming from Static Blocks that are allocated to a specific Site View.

This is added to the page via cms.xml. For example:

<block type="cms/block" name="cms_footer_links" before="footer_links_ic">
<!--
The content of this block is taken from the database by its block_id.
You can manage it in admin CMS -> Static Blocks
-->
<action method="setBlockId"><block_id>footer_links_ic</block_id></action>
</block>

This was fine until recently, when I noticed that suddenly all the sites had the same footer. I hadn't changed anything relating to the footers; although maybe the recent update to 1.9.2 was responsible?

Anyway, I don't understand why the footers now don't work properly. Please help, it's driving me crazy.
I don't know where to even start on this.


texts: How to create multiple web/store in magento2?

texts:
I want to create multistore website in magento2 for this my current system configuration is as follows-

Web server: Nginx
Magento Version: magento2.1.0
Cento OS Version: 7

for this I have followed below steps:

Created Website/Store/View in magento2 admin.
Added below code in pub/index.php

$params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = [
        DirectoryList::PUB => [DirectoryList::URL_PATH => ''],
        DirectoryList::MEDIA => [DirectoryList::URL_PATH => 'media'],
        DirectoryList::STATIC_VIEW => [DirectoryList::URL_PATH => 'static'],
        DirectoryList::UPLOAD => [DirectoryList::URL_PATH => 'media/upload'],
    ];

    switch($_SERVER['HTTP_HOST']) {
        case 'electronics-dev.local':
        case 'www.electronics-dev.local':
            $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'electronics';
            $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
            break;
        case 'magento2-dev.local':
        case 'www.magento2-dev.local':
            $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'base';
            $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
            break;
    }

    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
    /** @var \Magento\Framework\App\Http $app */
    $app = $bootstrap->createApplication('Magento\Framework\App\Http');
    $bootstrap->run($app);


texts: Table Rate Import Error - XAMPP - Magento 2.2.3

texts:
I'm trying to import table rates , weight vs destination into Magento 2.2.3 but it comes up with the following error:

The file "C:/Windows/Temp/E:/xampp/tmp/php9B36.tmp" doesn't exist

I tried this solution below, but all it does is change the error message to:

The file "C:/Windows/Temp/C:/xampp/tmp/php10B39.tmp" doesn't exist

magento2 shipping method :Table Rates import issue

How can I fix it?


texts:
in Magento 2 Layer navigation not showing. I set is_anchor Yes

I Reindexed i get success response also

Flush the cache delete cache folder also

What i need to do ?


texts: Composer " The "https://repo.packagist.org/packages.json" file could not be downloaded"

texts:
I'm using a mac, virtualbox with a bridged connection and Ubuntu server 20.04. I'm following this tutorial to install Magento 2 on this server. https://websiteforstudents.com/install-magento-2-on-ubuntu-20-04-18-04-with-nginx-and-lets-encrypt/
I can find a lot of people with this issue, but non of their answers seem to resolve this issue.
Does someone have experience working with virtualbox and linux server?
sudo composer create-project --repository=https://repo.magento.com/ magento/project-community-edition magento

Generates this error:
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Creating a "magento/project-community-edition" project at "./magento"
Installing magento/project-community-edition (2.3.5-p1)
  - Installing magento/project-community-edition (2.3.5-p1): Loading from cache
Created project in /var/www/shop/magento
Loading composer repositories with package information

  [Composer\Downloader\TransportException]
  The "https://repo.packagist.org/packages.json" file could not be downloaded
  : failed to open stream: Connection timed out


texts: Magento 2 graphql send createEmptyCart and addSimpleProductsToCart in same request

texts: Can I create a cart and add the products to cart in same request? Maybe using something like variables to pass by the cartId.


texts: How to get return value to .phtml file from controller?

texts:
Im creating a custom module. In my controller there is some ajax call and query like below,

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

            return $resultJson->setData([
                                        'Width' => $this->getRequest()->Width ,
                                        'Height' => $this->getRequest()->Height
                                        ]);
        }
        $post = $this->getRequest()->getPostValue();

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

        $sql = "SELECT price_component FROM " . $tableName . " WHERE width = " . $post['Width'] . "AND height = " . $post['Height'];
        $result = $connection->fetchAll($sql);
        return $result;
    }

  How can I get those return value into my .phtml file


texts: How to add custom error pages in Magento 2?

texts:
I'm having a problem since I'm new to Magento.

how can I create a custom error pages in my Magento 2 site?

For example these pages: 500, 401, 403, and 404. I hope someone can help me.

Thanks


texts: How to make related/up sell products display full width of screen?

texts:
In product page, product details tab appear below the images gallery along the full width of screen. Related products appear below the details tabs.

If details are moved to the right column (below the 'Add to cart' button), the related products block shrinks half screen.

How to make the related products block remain full width of screen?


texts:
What I am trying to do is to create a new template in my theme. I created a file in frontend/mytheme/default/template/page/2columns-left-cms.phtml. This is the content of it :

<!DOCTYPE html>

<?php echo $this->getChildHtml('head') ?>

<body <?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>

    <?php echo $this->getChildHtml('after_body_start') ?>
    <?php echo $this->getChildHtml('header') ?>

        <?php echo $this->getChildHtml('breadcrumbs') ?>

        <?php echo $this->getChildHtml('global_notices') ?>

                <?php echo $this->getChildHtml('global_messages') ?>
                <?php echo $this->getChildHtml('content') ?>

    <?php echo $this->getChildHtml('footer') ?>
    <?php echo $this->getChildHtml('before_body_end') ?>
    <?php echo $this->getAbsoluteFooter() ?>

When I want to select from cms/design from layout, my new template, it doesn't show up. So what xml do i have to change ? what should i do ? Can someone explain the process?

Thank in Advance...


texts: Layered navigation with 3-tier product structure

texts:
I have a custom 3-tier product structure where the associations are from grouped (GP) to configurable (CP) to simple products (SP). This is achieved using this extension. Standard associated table is used (i.e. catalog_product_super_link) for both GP-to-CP associations and CP-to-SP associations. Only GPs are visible on the frontend.

By default, the layered navigation shows the attributes of the parent and its immediate children, so it currently shows attributes of GPs and CPs only.

What I'd like to do:

I want layered navigation to include attributes of the simple products as well. I'm looking at Mage_Catalog_Model_Layer where a lot of the actions are happening, but I can't seem to find where it actually goes to the children products (in my case CPS) and grab their attributes.

At first, I thought instead of the product collection containing just the GP, I'll intercept it and append the GP's associated CPs as well, but it's more involved than I had imagined.

Any pointers?

I've looked at this if you were thinking about linking it: Ignoring Child Product Attributes in Layered Navigation

EE 1.13


texts:
OK, so I've copied a Magento 1.9 site over to a new server. I followed the answers to this to get my site working (instead of it redirecting to the old one).

My problem now is that I can't access the admin panel.  Every time I do, I get the following message:

Not Found

The requested URL /admin was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

This makes me think there is something else I need to get working.


texts: Magento 2: Set calculation based on Custom value

texts:
I want to do calculation based on that value in order summary extra field

 getValue: function() {
                var price = 0;
                if (this.totals()) {
                    price = totals.getSegment('fee').value ;
                var tex = totals.getSegment('fee').value ;
                price = (this.totals().subtotal) / tex;
                }
                // price = 101;
                return this.getFormattedPrice(price);

that was by fee.js file code I already do code but they not reflected can any one help me.


texts: Magento 2: Why the customer can't login on chrome browser?

texts:
Customer unable to login to his/her account on chrome browser. Chrome not allowing customers to login to his/her account while other browser allowing login of the customer to his/her account.

Please help I am using Magento 2.1.

Thanks.


texts: Magento 1: How to join these tables to get the result

texts:
$collection     = $this->_prepareEntityCollection(Mage::getResourceModel('customer/customer_collection'));

    foreach($collection as $customer){
       $_orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id',$customer->getId());
       foreach($_orders as $_ordersitem){

                $orderid    =   $_ordersitem->getEntityId();
                $collection_sales = Mage::getModel('sales/order_item')->load($orderid);
                 $pro_id  =   $collection_sales->getProductId();
                $_product = Mage::getModel('catalog/product')->load($pro_id);
                 echo '<pre>';print_r($_product->getCategoryIds());
        }
    }


texts: if I delete Category from Magento 1.9.2.4, will it affect at google indexing or search ranking?

texts:
I want to delete a category along with it's subcategory. I have assigned 500 products on this category and subcategory. I have some queries.

If I delete category and subcategories. will it affect on google indexing and google search ranking.
will it affect performance and urls related issue such 404 errors or broken links


texts: Cron readiness check failure! Found non-writable paths - for non-existant directory

texts:
In ver 2.2.5 of Magento CE, var/log/update.log contains errors similar to:

update-cron.ERROR: Cron readiness check failure! Found following non-writable paths:    /unqualified-path/magento2/.github [] []

But there is no such directory as magento2/.github !

There are a number of .github directories elsewhere, but the error persists even if I change their permissions to 777.

Additional info:
- shared server, I have no access to the account running Apache and cannot change ownership of the files to that account
- When first installed, using composer, the readiness check passed with no problem
- In general, both the frontend and the admin of Magento are working OK.


texts: Advanced Pricing Tab for Configurable - Magento2

texts:
I want to have The Advanced Pricing Tab for Configurable products in magento 2

alternatively is there anyway i can put discounts on products

Please help!


texts:
I have 2 multiple Store in site one India and other one US. I have Diiffrent Product Price for particular product in both store.

If i have open india store than my indian store product price display. Currently i am gettin US store price for this product. Any one have idea about how to change my price as per store.


texts:
I try to limit the number of products shown in a static cms block as follows

{{block type="catalog/product_list" name="product_list" category_id="4193" limit="4" mode="grid" template="catalog/product/list_custom_cat-grid.phtml"}}

I have tried others like

num_products="4" and columnCount="4" and some others but nothing works.


texts: Magento 2.3.2 - Products with same position in category sorting issue?

texts:
We recently migrated a store from M1 to M2.3 - the site has thousands of products and hundreds of categories.

Within each category, there are several instances whereby more than one product has the same position value. Why this is? I don't know.

Anyway, this category is sorted by "Best Value", which as I understand it, is position followed by entity_id (sorted in ascending order). So basically if 2 products have the same position, the one with the lowest ID is displayed first.

In Magento 2 though, it appears that it's the product with the highest ID first. So the category now has a big chunk of products listed backwards.

For example:

Magento 1

1) ID: 25, Pos: 0

2) ID: 53, Pos: 1

3) ID: 18, Pos: 2

4) ID: 25, Pos: 2

5) ID: 88, Pos: 2

In Magento 2, this is showing like this:

1) ID: 25, Pos: 0

2) ID: 53, Pos: 1

3) ID: 88, Pos: 2

4) ID: 25, Pos: 2

5) ID: 18, Pos: 2

So Product 18 and 88 have swapped places.

As you can imagine, this is creating difference between magento 1.9 & Magento 2.3 website about their positioning. It'll take a lot of manual work to re-assign the positions and prevent duplication.

Can anyone suggest any solution?


texts:
Using Magento 2.4.1, What am I missing to fix out of memory messages?

php -i | grep "memory_limit"
result ==>  memory_limit => 8192M => 8192M
then ran
php bin/magento setup:di:compile Compilation was started.

Repositories code generation... 1/9 [===>------------------------]
 11% < 1 sec 87.0 MiB mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory Fatal error: Out of memory
(allocated 190840832) (tried to allocate 135168 bytes) in
/home/xxxxt/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/FileClassScanner.php
on line 115

thereafter
php -dmemory_limit=8G bin/magento setup:di:compile compilation was started.
Repositories code generation... 1/9 [===>------------------------]  11% < 1 sec 87.0 MiBOut of memory
php -dmemory_limit=5G bin/magento setup:di:compile Compilation was started.
Repositories code generation... 1/9 [===>------------------------]  11% < 1 sec 87.0 MiBOut of memory
php -dmemory_limit=8G bin/magento setup:di:compile
The compilation was started.
Repositories code generation... 1/9 [===>------------------------]  11% < 1 sec 87.0 MiBOut of memory


texts: How I can change text of button 'Add to cart'?

texts:
I want to change text of button 'Add to cart' to 'Shop now' .

How and where I can do this ? because I want to change it in full website


texts:
I am trying to create a downloadable product in Magento 2.1.7 but when I try to upload the downloadable file, I am getting this error:

  Attention The file was not uploaded.

I tried changing the version but get the same result. Even when I try the direct URL to download the file, it shows error.


texts: Magento 2: Load a field based on another field in admin configuration

texts:
I am using Magento 2.2.0.

Here I need to load Attribute Type multi-select based on the option we choose in Document Type.

Is that possible by writing jQuery change events? If so, Where to add my js code to reflect here?


texts: Magento 2 : How to end all active sessions for a customer?

texts:
I was looking for possibility where i can give option to customer after password update to end all active sessions related to his account .

It would be helpful if can point in direction (even with a article link)


texts:
I see that the totals on PDF invoices, and on credit memo are pulled from one same abstract.php

Can I somehow make different totals on credit memo than on invoice? is there a way to make a copy of abstract.php only for credit memos?

I need to display some negative valuues in front of totals on my credit memo, so thats why I need this.


texts: What is causing InstallSchema Error Warning: array_key_exists() expects parameter 2 to be array, string given in

texts:
I'm trying to create a custom table in my module but I keep getting this error:

Warning: array_key_exists() expects parameter 2 to be array, string given in

I've been able to step through the code and it seems to break when this is executed:

$newTable = $setup->getConnection()->newTable($installer->getTable('orders'))->addColumn(
    'id', Table::TYPE_INTEGER, null, [
    'identity' => true,
    'unsigned' => true,
    'nullable' => false,
    'primary' => true
], ' Id'

)->addColumn(
    'orderid', Table::TYPE_TEXT,
    255, [
    'nullable' => false
], 'sku'

)->addColumn(
    'last_updated_date', Table::TYPE_DATETIME, null, [
    'nullable' => false
], 'last_updated_date'
)->addColumn(
    'total_price', Table::TYPE_INTEGER, null, [
    'nullable' => false
], 'price'
)->addColumn(
    'order_state', Table::TYPE_TEXT, 255, [
    'nullable' => false
], 'order_state'
)->addColumn(
    'fields', Table::TYPE_TEXT, 2048, [
    'nullable' => false
], 'fields'
)->addColumn(
    'order', Table::TYPE_TEXT, 255, [
    'nullable' => false
], 'o_id'
)->addColumn(
    'comment', Table::TYPE_TEXT, 255, [
    'nullable' => false
], 'comment'
)->addColumn(
    'read', Table::TYPE_SMALLINT, 1, [
    'nullable' => false,
    'default' => 0
], 'read'
)->addColumn(
    'in_stock', Table::TYPE_SMALLINT, null, [
    'nullable' => false,
    'default' => 0
], 'in_stock'

)->addColumn(
    'product_title', Table::TYPE_TEXT, 255, [
    'nullable', false,
], 'title'

)->addColumn(
    'qty', Table::TYPE_NUMERIC, null, [

], 'qty'

);

Can anyone tell what I'm doing wrong here???

This is where the exception occurs

  if (array_key_exists('default', $options)) {
        $default = $options['default'];
    }

vendor/magento/framework/DB/Ddl/Table.php on line 352


texts: Magento 2 : Custom Option Price + Finale Price = Show Total =>How?

texts:
Product Price: 100 USD
Custom Option: Premium: +50
Custom Option: Exclusieve: +100

I want it to show: 150USD. (instead of +50) if i choose Premium and 200(instead of +100) if i choose exclusieve.

public_html/vendor/magento/module-catalog/view/base/templates/product/price/amount/default.phtml

This is the file: But i can't get the finale price to work so i could sum it up.


texts: Magento 2 + Checkout Billing address Telephone Number Validation

texts:
I have created a plugin for billing address phone number validation, but it's giving me an error
Exception #0 (Exception): Notice: Undefined index: dataScopePrefix in /var/www/html/test/vendor/magento/module-customer-custom-attributes/Block/Checkout/LayoutProcessor.php on line 139

below is my code

Custom\BillingAddress\etc\di.xml

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

plugin -

Custom\BillingAddress\Plugin\LayoutProcessor.php

<?php
declare(strict_types=1);

namespace Custom\BillingAddress\Plugin;

class LayoutProcessor
{
    /**
     * Telephone number validation
     *
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array
     */
    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array $jsLayout
    ) {
        if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
            ['payment']['children']['payments-list']['children']
        )) {
            foreach ($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                     ['payment']['children']['payments-list']['children'] as $key => $payment) {
                $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                ['payment']['children']['payments-list']['children'][$key]['children']['form-fields']['children']
                ['telephone']['validation'] = ['phoneLax' => true];
            }
        }
        return $jsLayout;
    }
}


texts:
I have used below code to filter products by category id.

$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$catalog_ids = 4;
$productCollection = $_objectManager- >create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');

$collection = $productCollection->create()

->addAttributeToSelect('*')
->addCategoriesFilter(array('in' => $catalog_ids))
->addAttributeToFilter('status', '1')
 ->setOrder('ordered_qty', 'desc')
 ->load();

I am filtering product collection with the category.

Need to filter the collection was most sold items from the category.

How to achieve this. can anyone help me?


texts: how to export/import websites,stores,store-views?

texts:
I have a Magento install with 58 websites, and i need to recreate them in a new installation. Is there any way to export the database table which handle this?, and then import it in the new DB?.
Thanks!


texts: How can I add a menu in my magento backend?

texts:
Below is my code for my menu and it does not work on my side.

config.xml

<config>
<modules>
    <MasteringMagento_Example>
        <version>1.0.0</version>
    </MasteringMagento_Example>
</modules>
<global>
    <models>
        <example>
           <class>MasteringMagento_Example_Model</class>
        </example>
    </models>
    <blocks>
        <example>
            <class>MasteringMagento_Example_Block</class>
        </example>
    </blocks>
    <helpers>
        <example>
            <class>MasteringMagento_Example_Helper</class>
        </example>
    </helpers>
</global>

adminhtml.xml

<config>
<menu>
    <example translate="title" module="example">
        <title>Example</title>
        <sort_order>1000</sort_order>
        <action>adminhtml/example</action>
    </example>
</menu>


texts: Change text in Product Attachement Grid Magento 2

texts: How to change text in Product grid if any product not found. I have attached this in custom module and now want to change text according to my need.


texts: Magento 2.4 - No route 404 page loading with product page issue

texts:
I redirecting 404 not found page to product page using controller_action_predispatch_cms_noroute_index event observer.
Observer:
$request = $observer->getData('request');
$request->initForward();
$params = ['id' => $productId, 'category' => $categoryId];
$request->setParams($params)
    ->setModuleName('catalog')
    ->setControllerName('product')
    ->setActionName('view')
    ->setDispatched(false);

Product page loading perfectly but 404 not found page also loaded with it.
Does anyone have an idea?


texts: Magento2: How to remove ‘Add New’ button from Admin Grid?

texts:
How can i remove add new button from my custom module?
I follow below link but the button did not remove
-> http://blog.chapagain.com.np/magento-how-to-remove-or-rename-add-new-button-from-admin-grid/


texts: Magento 1.7 upgrade causes newsletter static block to stop working

texts:
I am sure this is simple but just can't figure it out.

I am trying to switch back to default newsletter signup for magento but am running into some issues.

When I use

{{block type="core/template" template="newsletter/subscribe.phtml"}}

The signup block displays but nothing is captured to the subscriber list

And if I use

{{block type="newsletter/subscribe" template="newsletter/subscribe.phtml"}}

Nothing displays at all.


texts: Does anyone have a script to pull a table from an external database to load into a CMS block? I have a database separate from Magento (a client list) that needs to populate a CMS block.


texts:
I want to add images to items in the grouped data table. My code is:

<?php $productImage = $_imagehelper->init($_item, 'product_base_image')
                        ->constrainOnly(false)
                        ->keepAspectRatio(true)
                        ->keepFrame(false)->resize(50)->getUrl();?>
<img src="<?php echo $productImage; ?>">

I add this column next to simple product name in grouped table on file grouped.phtml  but instead of base image from simple product i get defalut placeholder image.


texts: Magento 2 Change date format DD/MM/YY in all date fields ( my orders and other pages )

texts: My magento2 site date format is no like a MM/DD/YY format but I want to change DD/MM/YY format in my orders page and all other date fields. Please help me I tried and changed configuration settings JavaScript calendar but no changes in dates. Please help me by changing programmatically.


texts: add product list of category to newsletter

texts:
I am very new in Magento so please bear with me..
I want to add a grid of products from single category in my newsletter

{{widget type="catalog/product_widget_new" display_type="all_products" products_count="5" template="catalog/product/widget/new/content/new_grid.phtml"}}

I tried to add widget it is working but i need to show products from single category but i don't known how to achieve this please help.


texts: How to add new item (product) into existing order programmatically in Magento 2

texts:
I have created one virtual product in my Magento2 website. Now, I want to add it programmatically to the existing customer orders on some occasions with its custom price and name.

Can someone please guide step by step to achieve this?

Thanks,


texts: How to Magento 2 Enable JavaScript Bundling

texts:
I merged JS and CSS file Stores -> Configuration -> Advanced -> Developer -> Javascript Settings in production mode of magento2.

Once, I check via view source of the page, I can see the Javascript is merged.

But Still it's show 75 external Javascript scripts via GTMatrix HTTP requests.

So How can i removed that 75 external javascript requests?

Thank you in advance!


texts: Disable Custom Pricing From Orders Created in Admin For Products with MAP applied

texts:
I am hoping someone can help me out with this. I have searched for a long time and can find no answer.

Is there any way that I can disable the 'custom price' checkbox when creating an order from the admin panel based on specific attributes of the product?

I oftentimes offer customers a lower price but do not want to be able to do so if the product has MAP applied.

Is there any sort of 'if' statement I can apply here or any other solution that could help me?


texts: Magento 2: Different Merchant account on currency Base Payfor credit card Payment Method

texts:
I want to use my website for 5 regions without using store view solution. I have purchased magefan extension for Geo IP Currency Location. Now I am using paytrace services for payment now I want to change the configuration currency base
If visitor come from AED, the merchant account details of paytrace according to UAE.
how can I achieve this.


texts: Custom Module not working | Custom Code working fine

texts:
I am trying to get my custom module working and I am not sure where I am wrong.

Here is my app/etc/[namespace]_CustomPriceRevert.xml:

<?xml version="1.0"?>

<config>
    <modules>
        <[Namespace]_CustomPriceRevert>
            <active>true</active>
            <codePool>local</codePool>
        </[Namespace]_CustomPriceRevert>
    </modules>
</config>

I guess that works fine as I can see the module in Admin Panel > System > Configuration > Advanced > Advanced and it is enabled.

Here is the content of app/code/local/[Namespace]/CustomPriceRevert/etc/config.xml:

<?xml version="1.0"?>

<config>
    <modules>
        <[Namespace]_CustomPriceRevert>
            <version>0.1.0</version>
        </[Namespace]_CustomPriceRevert>
    </modules>
    <global>
        <models>
            <adminhtml>
                <rewrite>
                    <sales_order_create> Namespace]_CustomPriceRevert_Model_Sales_Order_Create</sales_order_create>
                </rewrite>
            </adminhtml>
        </models>
    </global>
</config>

Something wrong in here?

Here is content of my model app/code/local/[Namespace]/CustomPriceRevert/Model/Sales/Order/Create.php:

<?php

class [Namespace]_CustomPriceRevert_Model_Sales_Order_Create extends Mage_Adminhtml_Model_Sales_Order_Create {

    public function initFromOrderItem(Mage_Sales_Model_Order_Item $orderItem, $qty = null)
    {
        if (!$orderItem->getId()) {
            return $this;
        }

        $product = Mage::getModel('catalog/product')
            ->setStoreId($this->getSession()->getStoreId())
            ->load($orderItem->getProductId());

        if ($product->getId()) {
            $product->setSkipCheckRequiredOption(true);
            $buyRequest = $orderItem->getBuyRequest();
            if (is_numeric($qty)) {
                $buyRequest->setQty($qty);
            }
            $item = $this->getQuote()->addProduct($product, $buyRequest);
            if (is_string($item)) {
                return $item;
            }
// Custom-code
            if (
                !$this->getSession()->getReordered()
                && $orderItem->getOriginalPrice() != $orderItem->getPrice()
            ) {
                $item->setCustomPrice($orderItem->getPrice());
                $item->setOriginalCustomPrice($orderItem->getPrice());
            }
// end Custom-code
            if ($additionalOptions = $orderItem->getProductOptionByCode('additional_options')) {
                $item->addOption(new Varien_Object(
                    array(
                        'product' => $item->getProduct(),
                        'code' => 'additional_options',
                        'value' => serialize($additionalOptions)
                    )
                ));
            }

            Mage::dispatchEvent('sales_convert_order_item_to_quote_item', array(
                'order_item' => $orderItem,
                'quote_item' => $item
            ));
            return $item;
        }

        return $this;
    }
}

The custom code seems to work because when I added it to the core file it worked fine.

I'm working on magento 1.9.2.4. Can anyone tell me what I am doing wrong?


texts: Magento Docker container stops at "Running Magento install script"

texts:
I am new to Magento and Im trying to setup a Magento developer environment on Windows 10 machine with Docker. I'm using Bitnami Magento images and I managed to start up MariaDB and Elasticsearch docker containers as mentioned in the Bitnami Magento documentation. Once I started Magento container it stops from below log line (docker logs magento)

The magento container is not up as well. I tried several things to find out why this happens but I couldn't find out why. Any idea on this would be really helpful. Thanks.


texts: Is there a way that I could have a product be access to an embedded livestream?  All I want to do is have it to where someone can see my product details, and if they buy it, load the livestream.


texts: Magento 2 products backend, product title in list not the same as what is in product

texts:
When I load the magento backend, the product title does not reflect the title that is in the actual product.
For example, the product might say, "New jewelry ring set" and but in the actual product (when I go in and edit the product) I have changed it to something different, i.e. "Jewellery Set - New In Box - Free Shipping".

So the product's actual title and what is shown in the search, both backend and front end are not changing to what I changed it to.

It just stays the same as what it was.
I tried clearing the cache, restarting the indexers, reindexing, restarting the VPS server container, etc. but nothing seems to work.

Please help me.


texts: How to trigger default magento validation in custom module in magento 2

texts: I have created custom module for magento review module, Now All the functionalities works fine. But default magento validation is failed for Review form. Now, How do i trigger the dafault validation to my custom module


texts: We have a Magento site that operates as a marketplace, as in there are many stores and sellers to browse through. I can only find extensions for gift cards that would work as products and be available to buy only through a specific seller. What I'm looking for is a standalone type of gift card (think Amazon) that would work across the entire domain/marketplace/website, not just specific sellers. Does this make sense to anyone?


texts: Magento2 Remove success message time limit after coupon code is applied

texts:
How we can stop hiding success message after apply coupon code on the checkout page?
I need to keeping showing the success message after coupon code is applied & never auto hide. How can I achieve this?
https://prnt.sc/vm0ty8


texts: Save customer custom attribute in checkout

texts:
I'm really stuck with this thing. I added a customer address attribute with the following install data in my custom module

<?php
 namespace Vendor\Module\Setup;

 use Magento\Framework\Setup\InstallDataInterface;
 use Magento\Framework\Setup\ModuleContextInterface;
 use Magento\Framework\Setup\ModuleDataSetupInterface;
 use Magento\Customer\Model\Customer;
 use Magento\Customer\Setup\CustomerSetupFactory;

 class InstallData implements InstallDataInterface
 {

private $customerSetupFactory;

/**
 * Constructor
 *
 * @param \Magento\Customer\Setup\CustomerSetupFactory $customerSetupFactory
 */
public function __construct(
    CustomerSetupFactory $customerSetupFactory
) {
    $this->customerSetupFactory = $customerSetupFactory;
}

/**
 * {@inheritdoc}
 */
public function install(
    ModuleDataSetupInterface $setup,
    ModuleContextInterface $context
) {
    $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

    $customerSetup->addAttribute(\Magento\Customer\Model\Indexer\Address\AttributeProvider::ENTITY, 'fiscal_code', [
        'label' => 'Codice Fiscale',
        'input' => 'text',
        'type' => 'varchar',
        'source' => '',
        'required' => false,
        'position' => 66,
        'visible' => true,
        'system' => false,
        'is_used_in_grid' => false,
        'is_visible_in_grid' => false,
        'is_filterable_in_grid' => false,
        'is_searchable_in_grid' => false,
        'backend' => ''
    ]);

    $attribute = $customerSetup->getEavConfig()->getAttribute('customer_address', 'fiscal_code')
        ->addData(['used_in_forms' => [
            'adminhtml_customer_address',
            'customer_address_edit',
            'customer_register_address'
        ]
        ]);
    $attribute->save();
  }
}

The attribute is showing in admin panel and I can save it from there.

It's also correctly shown in checkout both in shipping an billing address forms, but no way to save it both for guest and registered users.

I'm using Magento 2.2.5

Any suggestion?


texts: Can't get the value of custom massaction attribute (in catalog_product_grid) when submitted

texts:
I have added a mass action using the following:

<?php

class Module_Groupfeatures_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid
{

    protected function _prepareMassaction()
    {
        parent::_prepareMassaction();

        $groups = $this->helper('customer')->getGroups()->toOptionArray();
        $this->getMassactionBlock()->addItem('groupfeatures_setGroupPrice', array(
                'label' => Mage::helper('catalog')->__('Apply Group Price'),
                'url' => $this->getUrl('*/applyprice/inbulk', array('_current' => true)),
                //'confirm' => $this->__("It is recommended that product indexing be disabled before continue"),
                'additional' => array(
                    'visibility' => array(
                        'name' => 'groupfeatures_Selectedgroup',
                        'type' => 'select',
                        'class' => 'required-entry',
                        'label' => Mage::helper('customer')->__('Group'),
                        'values' => $groups
                    ),
                    'additional'=>array(
                        'name' => 'groupfeatures_priceToApply',
                        'type' => 'text',
                        'class' => 'validate-number required-entry',
                        'required' => true,
                        'label' => Mage::helper('customer')->__('Group Price'),
                        'value' => ""

                    )
                )
            )
        );

    }
}

This outputs:

When I select products and submit I can get the product IDs using $this->getRequest()->getParams(); but I am unable to get the custom action values by dumping ...->getParams().


texts: Custom customer attribute search not working in admin

texts:
I added an attribute to customer, but when I try to search values of customer code on the backend, nothing comes up. I can't get my customer attributes to be included in search.
What can I do to get customer data entries to be searchable?
This in my upgradeData
  $customerSetup->addAttribute(
                Customer::ENTITY,
                'customer_code',
                [
                    'type' => 'varchar',
                    'label' => 'Customer Code',
                    'input' => 'text',
                    'required' => 1,
                    'visible' => 1,
                    'user_defined' => 1,
                    'sort_order' => 501,
                    'position' => 501,
                    'system' => 0,
                    'is_used_in_grid' => 1,
                    'is_visible_in_grid' => 1,
                    'is_html_allowed_on_front' => 1,
                    'visible_on_front' => 1,
                    "is_filterable_in_grid" => true,
                    "is_searchable_in_grid" => true
                ]
            );

        $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'customer_code');
            $attribute->setData('attribute_set_id', $attributeSetId);
            $attribute->setData('attribute_group_id', $attributeGroupId);

            $attribute->setData('used_in_forms', [
                'adminhtml_customer',
                'customer_account_create'
            ]);

            $attribute->save();


texts:
I have a weird problem with a small amount of my orders where there are 2 invoices being created for the same order.

There seems to be no correlation between the orders this is happening to. Different payment systems etc.

First of all, how should I resolve this in the admin section? Should I just create a credit memo for the order so 1 invoice is begin cancelled? I think this would mess up the stock count etc?

Second, any idea what might be causing this? Might I have configured the preferences wrong somewhere?

Extra information: I am using Magento 1.7 and am using the MultiSafepay - Gateways - 2.0.2 module. The option to automatically generate an invoice after payment has been ACTIVATED.


texts: Magento 1.9.4.1 - SUPEE-10975 - Failed. Outdated JQuery library v.1.12.0 found

texts:
I have upgrade version and during Magento security scan I got this error. I have removed old Jquery and added v.1.12.1

I replaced it in all page.xml. When I tried to check Jquery version of my store by running this from the console of browser

console.log(jQuery.fn.jquery);

I am getting result 1.12.0

I have scanned all file and not able to find 12.1.0 not sure from where scan getting it.


texts:
I am trying to override "vendor\magento\module-sales\view\frontend\templates\order\shipment\items\renderer\default.phtml" in my module.

I have copied vendor/magento/module-sales/view/frontend/layout/sales_order_shipment_renderers.xml in my module

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="sales.order.shipment.renderers">
          <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="Vendor_Module::order/shipment/items/renderer/default.phtml"/>
    </referenceBlock>
</page>

also I have copied the default.phtml in my module still not working.

Any suggestion where I am wrong?


texts: Magento 2 get Website names dropdown on any phtml

texts: How can we get the Website names dropdown (Website Switcher) in any phtml (Ex : header.phtml) in Magento 2


texts: Custom template file is loading after hard refreshing the page in Magento 2

texts:
I override vendor sale module template file Module-sales/view/adminhtml/templates/order/create/sidebar/items.phtml in custom module with directory name Vendorname/Companyname/view/adminhtml/layout/sales_order_create_index.xml to show a button in admin section of the sales order.
Here is the code of the XML file where I defined the template file path

  <referenceBlock name="cart">
            <action method="setTemplate">
                <argument name="template" translate="true" xsi:type="string">Vendorname_Companyname::order/create/sidebar/items.phtml</argument>
            </action>
        </referenceBlock>

But I am facing the issue to show the button directly to visit the customer section.

If I tried to hard refresh the page then a button shows that I defined inside the template file.

Can you please tell how can I shows the button directly without hard refresh the page.


texts: How to add new attribute like tier pricing in magento product form

texts:
I am working on jewel store in which need to get the stone/diamond options with its price and need to add them to the different charges that also will be given by admin.

Now i need to add attribute like tier pricing box where admin can add Number of diamonds/Stones and based on its qty/type i need to pull price from other model(Which is ok with ajax call).

Attached screenshot of how i want it(I edited it with firebug html from tier pricing)

Can anyone help me to understand how we can replicate the tier pricing block to this purpose and still tier pricing needs to work. Basically this is purely for admin UI purpose and it wont store all its values in that product attributes.

thanks in advance.


texts:
Good evening,
I'm creating a webshop based on Magento to sell my articles in France, as I'm ready to launch the shop today I was doing some test like signup with different accounts and making purchase and I notice one big issue regarding TAX, let me explain:

Tax should be paid as:

For FR customers (private) they pay taxes
For FR-B2B (companies) they pay taxes
For EU customers (private) they pay taxes
For EU-B2B (companies) they DON'T pay taxes
For outside EU customers (private) they DON'T pay taxes
For outside EU-B2B (companies) they DON'T pay taxes

Now what I did is to setup two store views, one in French and one in English, both have a list of 130 products, one list translated in French, the other in English while both list have same prices.

BACKEND

I setup a tax rate for French
I setup two customer groups (Private and Company)
I setup to apply TAX based on billing address

THE RESULT
- If I signup as a private user (without adding VAT number), Magento signup me with the Private group and bill me the VAT.
- If I signup as a company user (with VAT number), Magento do the same as before

If I signup as a UK, DE, PT or any user or company in Europe Magento doesn't bill me the VAT
If I signup as a private or a company outside Europe Magento do the same, doesn't bill me the VAT and assign me the Private group.

I spent an entire week reading many tutorials, even uploading EU tax rates, but nothing to do, I really don't understand what's wrong with my setup.

Lolly


texts: Magento 2 - Show error/success message as Alert/Modal

texts: I want to show Magento all success/error message as alert or in a modal. Is there any way to do that?


texts: Calling js function when product save button is clicked?

texts: I added new js file custom.js. What i want is to call a function when Save or Save And Continue Edit button is clicked. I am trying different things but its not working.


texts: How to pass Knockout.js value in controller in magento 2

texts:
I have value in knouckout js i am trying to pass it on controller or observer. what should i do? anyone can help me.

getSelectedValuecc: function() {
            /* jQuery(document).on("click", ".cusbtn", function (event) {
                if (!jQuery('input[name="payment[method_wallet]"]').is(':checked')) {
                var msg = "Please select any one options";
                    jQuery("#ccavneue_mssg").show();
                return false;
                }
                var radioValue = jQuery("input[name='payment[method_wallet]']:checked").val();
                //alert(radioValue);
                if(radioValue == 'paytm'){
                        jQuery("#ccavneue_mssg").hide();
                           jQuery("#cust_paytm").click();
                }
                if(radioValue == 'mobikwikwallet'){
                             jQuery("#ccavneue_mssg").hide();
                            jQuery("#submob").click();
                }
            });*/
            jQuery(function () {
            jQuery("#paytm_payment_profile_id").change(function () {
            //alert('select chnage');
            var selectedValue = jQuery(this).val();
            //jQuery('input[name="payment[method]"]').attr("disabled",true);
            if (selectedValue !=''){
               jQuery("#pay").show();
               jQuery("#address").show();
            }else{
                jQuery("#pay").hide();
                jQuery("#address").hide();
            }
            alert("Value: " + selectedValue);
            if(selectedValue == 'vsquare'){
               jQuery("#address").html("V Square Building 1st Lane, DwarakaNagar,Visakhapatnam-530016,AP.,India").show();
               jQuery("#paytm").click();
               return false;
            }
            if(selectedValue == 'pavanpalace'){
               jQuery("#address").html("A-1,Pavan Palace,near telugu thalli Flyover,Station Road, Dwaraka Nagar,Visakhapatnam-530016,AP.,India").show();
               jQuery("#paytm").click();
               return false;
            }
        });
    });
        //});,
    },

call this value on html

<select name="payment[method]" class="select input-text required-entry"
                            data-bind="
                                attr: {id: getCode()+'_payment_profile_id'},
                                event:{ change: getSelectedValuecc()},
                                options: getCardList(),
                                optionsValue: 'value',
                                optionsText: 'type',
                                optionsCaption: $t('--Select Store--'),

                                ">
         </select>

now i am looking for pass selectedvalue in save order before observer to save this value in table.


texts: Magento 2: Paypal - I'm sorry - but we were not able to process your payment. Please try another payment method or contact us so we can assist you

texts:
While doing payment with Paypal Sandbox suddenly it gives below error

  I'm sorry - but we were not able to process your payment. Please try
  another payment method or contact us so we can assist you.

In the log error it says

  main.CRITICAL: PayPal NVP gateway errors: Instruct the customer to
  retry the transaction using an alternative payment method from the
  customers PayPal wallet. The transaction did not complete with the
  customers selected payment method (#10417: Transaction cannot
  complete). Correlation ID: 620934b68a59c. Version: 72.0.

I tried to reenter credentials but still it gives same error.


texts:
CMS-Pages like imprint, terms, etc ... seem to have ?frontend=xxxxxxx GET-variable in URL.

How can I stop Magento from adding this to the URL?


texts: Trying to overwrite Amasty Checkout in custom theme Magento 2.2.7

texts:
I'm trying to overwrite a file belonging to the Amasty Single Step Checkout from within my custom theme. The file I'm trying to overwrite is:

vendor/amasty/module-single-step-checkout/view/frontend/web/template/onepage/2columns.html

I'm trying to do so by creating a custom file in my theme:

design/frontend/MYVENDOR/MYTHEME/Amasty_Checkout/template/onepage/2columns.html

after clearing cache and deploying my theme it doesn't seem to work, wht am I missing?

I'm in developer mode


texts: Getting Ajax Cart Pro to work with Quick View Pro

texts:
I'm using commercial modules AJAX Cart Pro by aheadWorks and Quick View Pro by BelVG but I'm having an issues getting the two to work together.

When the quick view modal opens up, clicking the add to cart button doesn't trigger the ajax.  Instead, it submits the form normally and redirects the customer to the cart page.

How can I get the ajax cart to work in the quick view window?


texts:
I know of a multi-billion dollar entity that has rebranded Magento 1 Community as their own creation and is then re-distributing to hundreds of unsuspecting customers who are not aware that they are indeed on Magento.

I believe this is a clear violation of Open Software License v. 3.0 (OSL-3.0)

"c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License"

Before reporting them first want to know if this is indeed a violation.

Sites are built on Magento Community.
All the admin panels have been altered to remove all mention of Magento.
Customers have no idea they are on Magento.
Organization is proudly stating in the press that the platform is their's.
I have documents to prove all of this.

Looking for feedback.


texts: "The attribute 'ifconfig' is not allowed" after upgrading to Magento 2.2

texts:
When I try to login in to the frontend, as a customer, I get this error:

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'referenceBlock', attribute 'ifconfig': The attribute 'ifconfig' is not allowed.
Line: 1052

I've read about other people running into the same issue here, with the solution being this.

I've never worked with reference blocks so I am unsure if they mean that I need to edit any of the Magento files or is the problem in my extensions?

EDIT

Found this in one of my extension layout files:

<referenceBlock name="customer_account_dashboard_top" ifconfig="cancelorder/general/active" template="CancelOrder::recent.phtml">

Could this be whats causing the error?


texts: Magento Observer object not containing anything

texts:
I have an observer method that triggers upon the event sales_order_creditmemo_save_after, basically when a credit memo was created. The method I have fires:

public function handleCreditmemoCreation(Varien_Event_Observer $observer)
    {
        //$observer contains data passed from when the event was triggered.
        $fp = fopen('/Applications/MAMP/htdocs/magento-1/var/log/request.log', 'a');
        fwrite($fp, $observer->getData());
        fwrite($fp, 'test');
        fclose($fp);
    }

However, $observer->getData() doesn't output anything into the request.log log file. To confirm I configured the file correctly, I write the string 'test' to the file, which works.

Also, when I check $observer for null, it tells me that $observer is not null. Does anyone know why then it does not seem to contain anything?


texts: Cannot change locale language : Magento 2

texts:
When I open my .co.uk website, it says a lot of stuff in Dutch from the pack I installed. I want my German website to be German, Dutch to be Dutch and English to be English.

  Why it is not working?

  How can I fix this?

I don't know from where to start. Is the switch able to be made in the database?

I tried to switch to developer mode, but than the system doesn't give a CSS to the backend, so I cannot get to the option.

My website:

  https://www.thefixedgearshop.co.uk

The storeviews:

Not switchable


texts:
i developed project in magento ce version 2.0 , also some addition feature purpose i need to add extension of reward point for money transfer extension.

so i decide purchase

http://demo.magestore.com/reward-points/api/index.php/admin/dashboard/index/key/6f37baae6c7590087136604a2fbcc9a7/

but problem is that this version is ce 1.9 and i installed magento ce 2.0 version setup so after purchase this 1.9 extension of reward point work on my magento version 2.0  if you have any idea then share to me....


texts:
In a .phtml template file I have loaded a productCollection using objectManager as follow:

$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
$values = [14];
$conditionType = "in";
$productCollection->addAttributeToSelect('*');
$productCollection->addCategoriesFilter([$conditionType => $values]);

I'd like to print a json with all the products, showing only the following product attributes:

Name
Sku
Link to img

What's the "Magento way" to do this? Thanks


texts: Call to a member function sendResponse() in magento 2 dirty play ground file

texts:
when I execute dirty play ground file in magento 2 I got the following error.

PHP Fatal error:  Call to a member function sendResponse() on null in /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php on line 259

Can someone tell me why I'm getting this error and how to resolve it.


texts: How to display customer attribute on frontend in magento

texts:
I have created module using http://silksoftware.com/magento-module-creator, in my module i have created three customer attributes to be displayed in admin and in frontend registration.

The fields get displayed in admin area, but it is not getting displayed in frontend registration form. When I click on Continue button in registration form it is giving me alert to enter those fields (fields created using module) but those are not displayed.

Can anyone have any idea about this??


texts:
Login to the website frontend in a customer account.
Click on "Account information" and edit some information (firstname, lastname, ...). Click on the save button. Now login to the magento backend and click on customers -> manage customers. Now you see the grid with the correct "updated_at" timestamp.
Login to the website frontend again. Click on "Account information"
And now click on "Addressbook" and edit some information. Click on the save button. Now go to the magento backend and click on customers -> manage customers. Updated_at is not changed.

Now i have a observer to solve the problem.
But there is no effect if i click the save button in the customer account / adressbook in the frontend.

Easylife_Meta.xml

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

Observer.php

<?php
class Easylife_Meta_Model_Observer
{
   public function autoMetaDescription(Varien_Event_Observer $observe)
    {
$_address = $observer->getEvent()->getCustomerAddress();
}
if (!$_address->hasDataChanges())
{
return $this;
}
$_customer = $_address->getCustomer();
$_customer->setUpdatedAt(Varien_Date::now())
->save();
}
?>

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Meta>
            <version>0.0.1</version>
        </Easylife_Meta>
    </modules>
    <global>
        <models>
            <easylife_meta>
                <class>Easylife_Meta_Model</class>
            </easylife_meta>
        </models>
    </global>
    <frontend>
        <events>
            <customer_address_save_after><!-- observe the event -->
                <observers>
                    <easylife_meta>
                        <class>easylife_meta/observer</class>
                        <method>autoMetaDescription</method>
                    </easylife_meta>
                </observers>
            </customer_address_save_after>
        </events>
    </frontend>
</config>


texts:
I want to add link in cart added message

Make shopping Cart as link

In checkout cart add controller i am changing message like this

$message = __(
                    'You added %1 to your shopping cart.',
                    $product->getName()
                );

but its getting text when i look in console its come from knockout js and they are getting html "html: message.text" of message but its getting like text

How can i change it


texts: Magento1 Mage::getStoreConfig non cached value

texts: Is there a way to get a non-cached config value from Magento using Mage::getStoreConfig without having to first flush the entire config cache?


texts: Change Simple Products to Manage Stock = No

texts:
I want to change all my simple products to not manage stock and thus I need to change two fields

manage_stock... to be manage_stock = no
use_config_manage_stock... to be use_config_manage_stock = no (this way it won't use the default.)

my MySQL query would be something along the lines of...

UPDATE `my_database`.`cataloginventory_stock_item` SET `manage_stock` ='0' AND `use_config_manage_stock` ='0'
WHERE...

WHERE? this is where I struggle... I need to do where the type = simple, however I don't know where this data is held?

thinking about this its a little more complicated. Actually what I need to do is to do all simple products which are not associated to a configurable product...

Is this possible?

Henry


texts: Transferring / reinstalling Magento on server

texts:
I've tried for hours to get Magento running on my webspace, but it just doesn't work.

I already have it running locally with xampp and everything seems to work fine.

When I upload the files and the database and change the mysql connection data and the base url in the db, I get the index page without proper style and formatting and without images and the links don't work, I always get a 404 error.

I tried to reinstall by deleting the appropriate files, but somehow I get either a database connection error or the error message that says invalid url. The index page was able to connect and I know the connection information is right.

Has anyone an idea what the problem might be or where to look for further information?
Here's the phpinfo() output: http://gyazo.com/300e884f8837bc98f64474695f5974d0


texts: How to override Magento model in a subdirectory?

texts:
I'm trying to override a function in Mage_CatalogRule_Model_Rule but I can't get it to work.

config.xml

<config>
    <global>
        <models>
            <rule>
                <rewrite>
                    <rule>Apptha_Timer_Model_CatalogRule_Model_Rule</rule>
                </rewrite>
            </rule>
        </models>
    </global>
</config>

/app/code/local/Apptha/Timer/Model/CatalogRule/Model/Rule.php

class Apptha_Timer_Model_CatalogRule_Model_Rule extends Mage_CatalogRule_Model_Rule {
    protected function _convertFlatToRecursive(array $data) {
        //not called
    }
}

What am I missing? I've been able to override controllers and blocks just fine.


texts: Magento 2 authorize.net alert click on palce order button

texts:
I have added the extra filed after credit card filed.

We want to custom validate the extra filed or simply any alert on click of palace order button.

We used validate method on authorizenet-directpost.js but not working.

authorizenet-directpost.js

define(
    [
        'jquery',
        'Magento_Payment/js/view/payment/iframe',
         "mage/validation"
    ],
    function ($, Component) {
        'use strict';

        return Component.extend({

            defaults: {
                template: 'Magento_Authorizenet/payment/authorizenet-directpost',
                customerPoNumber: '',
                timeoutMessage: 'Sorry, but something went wrong. Please contact the seller.'
            },
            placeOrderHandler: null,
            validateHandler: null,

             initObservable: function () {

                    this._super()
                            .observe(
                                    ['customerPoNumber'

                                    ]
                                    );
                    return this;
                },
                    getData: function () {
                    return {
                        "method": this.item.method,
                         "additional_data": {
                            'po_no': this.customerPoNumber(),

                        }
                    };
                },
           validate: function () {  //My custom valiadte method but not working.
         alert("On click Place order Button");

                },

            /**
             * @param {Object} handler
             */
            setPlaceOrderHandler: function (handler) {
                 return false;
                this.placeOrderHandler = handler;
            },

            /**
             * @param {Object} handler
             */
            setValidateHandler: function (handler) {
                this.validateHandler = handler;
            },

            /**
             * @returns {Object}
             */
            context: function () {
                return this;
            },

            /**
             * @returns {Boolean}
             */
            isShowLegend: function () {
                return true;
            },

            /**
             * @returns {String}
             */
            getCode: function () {
                return 'authorizenet_directpost';
            },

            /**
             * @returns {Boolean}
             */
            isActive: function () {
                return true;
            }
        });
    }
);

Please help on above issue.
Any help or suggestions are highly appreciated.Thanks


texts: Magento 2 Programmatically update attribute fields from csv

texts:
I had a custom script for 1.9 that did this but it does not work on 2.0.

Could someone provide any help or pointers to help get this working.

Once a day I would like the script to update the magento inventory from a CSV files with three columns, the three columns are sku, price qty.

Any help is greatly appreciated.

Here is similar code i used in 1.9 as requested. Any help is appreciated.

 <?php
/*Move to our working directory
   $home = getenv("HOME");
   if (! $home) {
           chdir('../'); // We hope we are somewhere where this works
   } else {
           chdir($home.'/project/html');
   }*/
$csv = "CSV-File-With-updates.csv";
if (sizeof($argv) > 1) {
$csv = $argv[1];
}
//Turn On Error Reporting
error_reporting(E_ALL | E_STRICT);
//BOOTSTRAP MAGENTO
$mageFilename = '../app/Mage.php';
require_once $mageFilename;

//require_once 'relatedProducts.php';
  Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
Mage::setIsDeveloperMode(true);
umask(0);

//OPEN CSV
if (($handle = fopen($csv, "r")) !== FALSE) {
 while (($data = fgetcsv($handle, 2000, "\t")) !== FALSE) {
    $num = count($data);
    if ($num < 1) continue; // skip blank lines
    $sku = trim($data[0]);
    if ($num < 2) {
        echo "Skipping: ".$sku." not enough fields\n";
        continue;
    }
    $qty = trim($data[1]);
    $price = trim($data[2]);
 // grab the product based on sku.
    $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
    if(!$product) {
        print "Error:  Invalid SKU, ".$sku."\n";
        continue;
    }
    if ($product->getPrice() != $price) {
        $product->setPrice($price);
        $product->save();
    }
// Grab the inventory(stock) model in order to update quantities.
    $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId());
    if ($stockItem->getData('qty') != $qty) {
        $stockItem->setData('qty', $qty);
        if ($qty > 0) {
            $stockItem->setData('is_in_stock', 1);
        }
        $stockItem->save();
    }
}
fclose($handle);

}


texts: I wonder that is there any way to set Magento default invoice pdf language different with Interface Locale in Account Setting?


texts: Get company name when adding new address

texts:
I am trying to fill in the field: Company, when adding a new address, retrieving the company name from the current address.

I am editing:
/www.vadotex.biz/web/app/design/frontend/vadotex/default/template/customer/address/edit.phtml

and have tried:

<?php echo $this->htmlEscape($this->getCustomer()->getShippingAddress()->getCompany()) ?>

and

<?php echo $this->htmlEscape($this->getCustomer()->getAddresses()->getCompany()) ?>

as value of the field.

I want it to copy the company name of the current shipping address, but when using above codes, it wont show me any value, and just cuts off the form.


texts: How do I add custom URL parameters to magento?

texts:
I want to be able to list out all the products by a specific manufacture.

I've been able to get a list of all the manufactures

function getAllManu()
    {
      $product = Mage::getModel('catalog/product');
      $attributes = Mage::getResourceModel('eav/entity_attribute_collection')
                  ->setEntityTypeFilter($product->getResource()->getTypeId())
                  ->addFieldToFilter('attribute_code', 'manufacturer'); //can be changed to any attribute
      $attribute = $attributes->getFirstItem()->setEntity($product->getResource());
      $manufacturers = $attribute->getSource()->getAllOptions(false);

      return $manufacturers;
    }

But I don't know what to do next.

url string should be something like this:

website.com/manufacture/   (with pagination support)

EDIT

I'm guessing I need to do my own controller and extend extends Mage_Core_Controller_Front_Action


texts: Paypal Payflow Pro : Not signed up for this tender type - 25

texts:
I am using PayPal Pay-flow pro payment method on my magento store. Now when I enabled it "PayPal express (papal UK express)" is automatically enabled.

Now issue is when I try to place an order this PayPal UK express payment method that time I am getting an error message

[response] => Array
 (
    [RESULT] => 25
    [RESPMSG] => Not signed up for this tender type
 )

So can anybody please help me why this is happening ?

Please note that I am using sandbox account.


texts: Magento 2 : Change color in magento add to cart button

texts: How can I change color add to cart button in Magento 2 ??


texts: php bin/magento setup:upgrade error help

texts:
I installed a Magento extension and after running php bin/magento setup:upgrade, I get the following errors. I've tried hours trying to find a solution. I even got my server company to help, but no luck.

I'm running Magento 2.3.4 with PHP version 7.2

PHP Fatal error:  Uncaught Error: Call to undefined function JsonSchema\Uri\filter_var() in /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php:82
    Stack trace:
    #0 /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(100): JsonSchema\Uri\UriResolver->resolve('file:///home/th...', 'internal://prov...')
    #1 /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(72): JsonSchema\SchemaStorage->expandRefs(Object(stdClass), 'internal://prov...')
    #2 /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php(58): JsonSchema\SchemaStorage->addSchema('internal://prov...', Object(stdClass))
    #3 /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php(78): JsonSchema\Validator->validate(Object(stdClass), Object(stdClass))
    #4 /home/thesuitexchange/thesuitexchange/vendor/composer/composer/src/Composer/Json/Jso in /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php on line 82


texts: Best Practice for staging/development site

texts:
I am new to magento and have been working a my first site and it is now ready to go live. I have been advised that once live to also build a staging or development site so that i can in the future work off that before putting any new changes to my live site.

Can i ask what are the best practices in setting this up? My web hosting has said they can offer to set it up within a sub directory of my existing domain but it will just be a copy of the files and database (so doubling my required disk space) and i would need to manually move and copy the files and database info. Is this the only way?

I did see one article but it required a virtual server to store the test site on which i don't have or have any knowledge in setting up


texts:
How to create a footer link in custom theme and how to set path to that link ?

I have created custom feedback module which contains form for feedback.

Now I need to set link in custom theme and want to set path for the link.

The path should refer from my feedback module** Please help me

=> Custom Module:layout file

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

        <title>
            Sample
        </title>

       <referenceContainer name="footer">
            <block class="Magento\Framework\View\Element\Template" template="X_Y::form.phtml"/>
        </referenceContainer>

</page>

form.phtml

    Feedback
.....
....
....

While clicking link it will show a popup. So here I have mentioned id, Now I have declared my link in custom theme, But How do I specify this id in link


texts: Magento 2.1 less not updating on frontend

texts:
Im using Magento 2.1 with ubuntu.

I am creating a custom theme that inherits from a third party theme.
The problem I am encountering is that I am overriding the .less files and making my changes, however the changes are not appearing when I refresh.

Am I possibly not overriding the correct files?

I have cleared the cache and also "Flush Static Files Cache".

What should I do to ensure my changes are not overridden by the parent? Use _extend.less?


texts: Mage GetResourceModel in specific language in magento 1.9

texts:
I am working on a module to pull inventory data into a feed. For this we use Mage::getResourceModel.

Pulling the data works alright, I just have the problem that the language changes depending on the origin of the requesting client.

How do i pass the right Filter to keep the language in let's say italian?

     //get product types
    $productTypes = $this->getProductTypesSQL();
    $productIds =  $this->getProductIds($page, $limit, $productTypes);

    $collection = Mage::getResourceModel('catalog/product_collection')
        ->addAttributeToSelect('*')
        ->addFieldToFilter('entity_id', array('in' => $productIds))
        ->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

This code pulls a collection of items alright, however the language is defaulted by the client's location.


texts: Check if email already subscribed (on newsletter)

texts:
I have a custom popup for email signup to the newsletter, and add the email via a custom module, which works fine.. but, It seems to allow duplicate emails, which I don't want.

How can I check if an email is already subscribed?

One additional question if anyone knows; When guests subscribe with their email, can I also add their names somehow, or would I need to add a custom field to db first?


texts:
I have a custom module serving a template with the following img tag:

<img src="http://example.net/pub/static/frontend/Magento/blank/en_US/Company_Module/images/berry.jpg" alt="berrylicious">

Certainly, there has to be a better way to include static files.

Should I be declaring these images in a layout file? Is there a shortcut I can use to link to the static files?


texts: Is there any way to change getConfig method (AbstractHelper class) to be a static method?

texts:
I'm new to Magento 2 and from what I know, in order to retrieve config values, you need to extend the AbstractHelper class and create a method:
public function getConfig($config_path)
{
    return $this->scopeConfig->getValue(
        $config_path,
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
    );
}

Is there any way to transform this method into a static method?
Thanks in advance.


texts: Magento URL Rewrite Management linking Pages to Nav Bar

texts:
I am trying to link a CMS page to the navigation bar however under url rewrite management I keep receiving " Request Path for Specified Store Already exists. This is what I've done...

1) created the page Portfolio under CMS -> Pages.
Title Portfolio : URL Key portfolio

2) created subcategory Portfolio: Active YES : Include in Navigation Menu YES : URL Key portfolio1

3)Go to URL Rewrite Information and place the following in
and receive the message "Request Path for Specified Store Already Exits:

Please help - I have already tried  http://jc-designs.net/blog/2012/09/magento-adding-cms-pages-to-the-main-navigation/


texts:
I would like to ask if it's possible to make magento ignore a string added to a product url. For example, I have a product url: http://mywebsite.lc/product-name

Is it possible that when entering: http://mywebsite.lc/product-name/some-string

magento can still understand and direct to: http://mywebsite.lc/product-name while keeping the string on the url?

I need the string part for some js functions, and also for a friendly URL.

Thanks you


texts:
I tried both Magento v2.1rc3 and Magento2 develop version from git repository.

Problem is that when I tried to change Magento 2 theme, I followed below steps:

Open BO -> Stores -> Configurations -> General -> Design

And I don't see "Design Theme" section with theme select dropdown anymore.

I tried to look deeper in this and found that node with this configuration was removed from system.xml(Magento\Backend module). I found commit with removing this node in history  of Magento2 git repository and it has have message "Remove old code."

So, I hope this configuration was moved to some another place in Back Office of Magento. But I don't found it in any of the system.xml files. Maybe someone know why it was done and in what way I can change my Magento 2 theme?


texts:
I want to create Rss Feed for my blog. I am using extension for blog.
How can I achieve this in magento2?


texts:
Is there any way to manage partial shipments within magento?

Scenario: - I have a customer that order some items ( some of which would be back ordered ) - I want to ship him items that I have in stock and instead of having the order marked as Complete, possibly have it marked as Partially Shipped

Any way of possibly going about that ?

Side note: I use a program called Acctivate for order processing and invoicing, which automatically sends the shipping information and whats back ordered and what not, however whenever even a partial shipment is shipped, magento simply marks it complete and lists all products on the order as shipping, which is also not working as intended.


texts: Create extension attribute to quote_item table

texts:
I am trying to create extension attribute to quote_item table but in
module-quote I haven't seen any QuoteItemInterface, but there is CartItemInterface.  I tried with that

extension_attributes.xml

<?xml version="1.0"?>
<config>
    <extension_attributes for="Magento\Quote\Api\Data\CartItemInterface">
        <attribute code="sample_field" type="string">
        </attribute>
    </extension_attributes>
</config>

but not working ,
how can I set and get extension attributes to quote_item table ? How can I check the field is created or not ?