texts: Magento URL Generation works. Visiting its link 302 redirects me

texts:
I'm having a bit of trouble that arose recently.  We had installed a module called Ajaxify that we used as a base for getting some ajax-module things working.  This used to work all fine and dandy but after some changes in our system setup (not sure if it was code-based or server configuration-based) it isn't working anymore.

The problem that we're having is that even though the URLs generate fine, when we visit them we get 302 redirects and that causes problems with Prototype's Ajax setup we have going on.

For example, it uses Mage::getUrl to generate all of the links. Mage::getUrl('ajaxify/index/reviews') returns http://mybaseurl.com/index.php/ajaxify/index/reviews/?productid=15&storeid=1&page=2.  When I end up visiting this URL it redirects me to https://mybaseurl.com/index.php/ajaxify/index/reviews/ (note the lack of parameters, https, etc.)

Could it possibly be our server configuration?  I've included our web setup for Magento URLs below.  We are running Nginx so I'm not sure if that has anything to do with this or not.  The funny thing is that this was working less than a week ago.

Image(I have ten rep why can't I post this image?): http://i.stack.imgur.com/06Qiw.png

Please note that if you would like to test out the functionality I am referencing you could replace mybaseurl.com with the URL linked in the picture.  I just didn't want to publicly have that URL just sitting there.  http://mybaseurl.com/citizen-tokyo.  Once you are on the page feel free to click the read more link (near the bottom as an image button).

Thanks in advance and hopefully somebody can help me at least figure out why this is redirecting.  Cheers!


texts: Magento 2 Redirect shopping cart link on message notification in iframe

texts:
I can not redirect to the shopping cart link outside the iframe.
It still redirect but it stays in the iframe. magento 2.2.6
when i click shopping cart

result :

I want it redirect to shopping cart but not in iframe.
Can anyone help me ?


texts: 5000 Unique Visitors daily, 3000 return visits so 8000 total visitors daily, 1000 products, which server do i need to make magento fly

texts:
searching for the right server to host your magento site is a job in itself, I've been shopping around and some host told me i need minimum these specs on a dedicated server to make it run smooth
2x Hex Core E5-2420

600 GB Disk Space RAID-10
CDN Data Traffic
Redis Cache & Memcached
24 GB DDR3 1333Mhz RAM
650 GB/mo Data Usage
1 Dedicated IP
Unlimited Additional Stores
E-mail Hosting Included

and others told me, this will do the job
Quad Core 3Ghz+ Xeon CPU

8 GB Dedicated RAM
2 IP Address
60 GB SSD and 500GB SATA HDD
1TB Bandwidth

And obviously between these 2 configurations there is quite the price difference, any advice on this please, thank you

Jay


texts: Multidomain - Second Domain - blank page?

texts:
There are already a lot of posts to Multidomain, but since 1.8.1 something is wrong.
Installation: Magento CE 1.8.1 (fresh install 1.8 and update to 1.8.1)
Webserver: vHost on CentOS and Plesk v11.5.30

The Problem:
If I set the second website as "default store" the base domain shows a blank page only.
If I put the first website back as "default store, it is showing up the base website correctly.

Is there something missing?


texts: Centre products image on the wishlist section on the Customer Account dashboard

texts: Above screenshot as you can see my products image is coming on the left corner i want to make it centre, how can i do it please help.


texts:
I am getting the below mentioned string in my API response. How can I convert this into array?

 "product_options": "{\"info_buyRequest\":{\"qty\":1},\"giftcard_lifetime\":null,\"giftcard_is_redeemable\":0,\"giftcard_email_template\":null,\"giftcard_type\":null}"

  Vendor/CustomApi/Model/OrderHistory.php

<?php

namespace Vendor\CustomApi\Model;

use Amos\CustomApi\Api\OrderHistoryInterface;
use Magento\Customer\Model\CustomerFactory;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Framework\Exception\NoSuchEntityException;

class OrderHistory implements OrderHistoryInterface {

    protected $customerFactory;
    protected $customerRepository;

    public function __construct(CustomerFactory $customerFactory, CustomerRepositoryInterface $customerRepository) {
        $this->customerFactory = $customerFactory;
        $this->customerRepository = $customerRepository;
    }

    public function getOrderHistory($customerId, $direction, $pageSize, $currentPage) {
        try {
            $customer = $this->customerFactory->create()->getCollection()
                    ->addAttributeToSelect("*")
                    ->addAttributeToFilter("entity_id", array("eq" => $customerId));
            $CustomerResult = $customer->getData();
            $customerInfo = $this->customerRepository->getById($customerId);
            $customerAttributeData = $customerInfo->__toArray();
            $VesselId = $customerAttributeData['custom_attributes']['customer_vessels']['value'];
            $customerData = $this->customerFactory->create()->getCollection()
                            ->addAttributeToSelect("*")
                            ->addAttributeToFilter("customer_vessels", array("eq" => $VesselId))
                            ->addAttributeToFilter("group_id", array("eq" => self::GROUP_ID))->load();
            $CustomerDataResult = $customerData->getData();
            $captinId = $CustomerDataResult[0]['entity_id'];
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $order = $objectManager->create('Magento\Sales\Model\Order')->getCollection()->addAttributeToFilter('customer_id', $captinId)->setOrder('entity_id', $direction)->setPageSize($pageSize)->setCurPage($currentPage);
            $orderInfo = $order->getData();
//            print_r($orderInfo);die();
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $orderItemCollection = $objectManager->create('Magento\Sales\Model\ResourceModel\Order\Item\Collection')
                    ->setOrder('entity_id', $direction);

            $orderItemCollection->getSelect()->joinLeft(
                    'sales_order', 'sales_order.entity_id=main_table.order_id', ['increment_id']
            )->where('sales_order.customer_id=?', $captinId);
            $orderResult = $orderItemCollection->getData();
            foreach ($orderInfo as $k => $v) {
                foreach ($orderResult as $k1 => $v1) {
                    if ($v1['order_id'] == $v['entity_id']) {
                        $orderInfo[$k]['product_details'][] = $v1;
                    }
                }
            }
        } catch (\Exception $e) {
            throw new NoSuchEntityException(
            __('Invalid customer.')
            );
        }
        return json_decode($orderInfo);
    }

}

  Vendor/CustomApi/Api/OrderHistoryInterface.php

<?php

namespace Vendor\CustomApi\Api;

interface OrderHistoryInterface {
     CONST GROUP_ID = 5;
    /**
     * User can login and once logged in success, user will receive their information with order history.
     * @param int $customerId
     * @param string $direction
     * @param int $pageSize
     * @param int $currentPage
     * @return mixed Order History
     */
    public function getOrderHistory($customerId,$direction,$pageSize,$currentPage);
}


texts: I have created a system backup, in the Magento 2 backup in backend. But when i click the link to tgz file, i just get a blank page, and it will not start downloading. It works with sql.


texts: Change product price in cart each page loaded with observer

texts:
I tried to update the price of each product in cart each time I load a page. I used observer and event catalog_product_collection_load_after. I tried to get each item in the cart from observer but its always null if I do var_dump for it. Am I doing it wrong?

Observer :

public function execute(\Magento\Framework\Event\Observer $observer) {
     $quoteItem = $observer->getQuoteItem();
     var_dump($quoteItem); //always NULL
}


texts: How to validate custom text field in magento checkout form

texts:
I have added custom checkout field in magento 2, and made it required, how can I add more validations and custom messages.
Below is my code snippet to make it required:

dataScope' => 'shippingAddress' . '.' . $customAttributeCode,
            'description' => 'Save This Address',
            'provider' => 'checkoutProvider',
            'sortOrder' => 40,
            'id'  => 'shipping_dob',
            'value' => '',
            'label' => 'Shipping Birth Date',
            'placeholder' => 'MM/DD/YYYY',
            'validation' => [
               'required-entry' => true
            ]


texts: Order status in an order is different than in the table of all orders

texts:
I encountered a strange habit in my Magento installation. Very few of my orders have the state "complete" in the order overview. But if I query all orders in the order summary table (sales -> orders), these orders are listed as processing.

Some of these order vanished after some weeks while other orders persist. Sometimes a new order with this habit appears.

Why are order listed in the table of all orders as processing, while these order were completed? I never saw something like this.

I rebuild every cache and every index. I have got the idea that this might something be wrong with building the flat_order tables in the database. But I have to knowledge how to debug this.

Can anyone give me a clue to dig for?

Thx, Danny


texts: Convert the currency format to USD for the purchases outside India

texts:
I have set up my magento store with magento 1.9. I want the currency format to be automatically converted to USD throughout my magento store, if the customer is purchasing from any country other than India. Can anyone kindly tell me how I can do this?

Edit: The answer given by Emipro Technologies Pvt. Ltd. below worked out for me I am also posting an answer with a function to find IP too. So the whole function would work available for those who search for the same. Find the whole answer below.


texts: Force Cart price calculation for configurable products

texts:
I have a custom module which adds multiple products to the cart.
The user is then redirected to the listing page where she comes from.

In the header, the total price of the cart items is shown.
Problem is: this Price won't update!
If I add another product, the price of the product added before is added.
So the price shown is always the price before the last product(s) were added to the cart!

If I open the cart page, the correct price is shown!
How can I force magento to recalculate the price?


texts: Single HTTP Request to magento spawns numerous PHP/MySQL processes

texts:
Using PHP 5.5 and MySQL 5.6 with magento 1.7 on Centos server.

When navigating to my site "example.com," an endless supply of PHP and MySQL processes are started. In can take minutes for a page to load on my browser, if it ever does. On the server, from the command line, using top I see PHP processes multiplying. Logging into MySQL, I see that it also is bogged down with an ever increasing number of sleeping processes. And in Magento's var/session/ folder, a new session is created at least once per second. If I run ls | wc -l repeatedly, I can see the number of sessions going up very quickly.

And I can solve the entire problem by simply adding a deny from [server's own ip address] in the magento .htaccess folder. After doing that, and restarting MySQL and Apache and clearing out all the zombie sessions, the site works perfectly. That's great, but it doesn't explain how this is happening, and it makes me worry that there could be side effects I don't know about.

Does anyone have any idea what is going on?

EDIT: update

I've discovered that the problem can be avoided if I comment out this line in .htaccess:

RewriteRule .* index.php [L]

That allows me to access the home page without any problem. Catalog pages stop working because Magento's rewrite option is turned on. Turning it off makes them work, but also adds the ugly "index.php" back into all urls.

Does this give any clues as to what the problem is?


texts: Use custom layout handle for cms page view

texts:
I'm trying since hours to get my custom layout handle to work.
I have a cms page that calls the layout handle "cms_page_view".
Now I want to set in my custom module a new layout handle:

config.xml

<page>
    <layouts>
        <cms_page_view module="page">
            My Page
            <template>page/mypage.phtml</template>
            <layout_handle>cms_page_mypage</layout_handle>
        </cms_page_view>
    </layouts>
</page>

<frontend>
    <layout>
        <updates>
            <custom_mymodule>
                <file>custom/mypage.xml</file>
            </custom_mymodule>
        </updates>
    </layout>
</frontend>

In my new layout file (custom/mypage.xml):

<?xml version="1.0"?>
<layout>
    <cms_page_mypage translate="label">
        MyPage
        <reference name="root">
            <action method="setTemplate">
                <template>page/mypage.phtml</template>
            </action>
            <action method="setIsHandle">
                <applied>1</applied>
            </action>
        </reference>
        <block type="page/html_head" name="head_mypage" as="head_mypage">
            <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>
            <action method="addItem"><type>skin_css</type><name>css/styles-ie8.css</name><params/><if>lt IE 9</if></action>
            <action method="addCss"></action>
            <action method="addCss"><params>media="print"</params></action>
        </block>
    </cms_page_mypage>
</layout>

In my cms page in the backend I wrote this in the conent area:

{{block type="core/template" name="my_page" as="content" template="page/html/my_page.phtml"}}

And in the end ... nothing happens when I call my page/mypage.phtml with this content:

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

What am I missing here???


texts: Magneto 2.x Questions | Get Shipping Methods Clears Credit Card Data

texts:
We completed our 1.x to 2.x upgrade and we are having some lingering issues.
Magento ver. 2.3.5
Our shipping method is always free shipping
When we are taking phone orders and we go to Sales >>Orders >> new we have to click get shipping methods and it deletes credit card data. For now we are trying to remember not to enter credit card data until this is entered, but curious if there is a way to preload this or stop it from clearing data.
Purchase Order We do not accept that via online orders but in 1.x we were able to have it available for us manually on phone orders. Is there a way to get a payment method to appear for manual orders but not to the public
*** Address Verification***
It appears you have to use the sales tax vendor they have listed to get address verification. Is there an easy affordable way to get address verification?
Coupon Codes
Is there a setting to keep coupon codes from applying to sale prices? We have a hack right now. Created an invisible category SALE, put sale items in that category and manually exclude that category from every coupon code individually
Thanks
Justin Krauss


texts: Function of php echo $this->escapeHtml($this->getUsername()

texts:
I have the below piece of code

                    *<?php echo $this->__('Email Address') ?>

                        <input type="text" class="input-text required-entry validate-email" id="login-email" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" />

                    *<?php echo $this->__('Password') ?>

                        <input type="password" class="input-text required-entry" id="login-password" name="login[password]" />

                <?php echo $this->getChildHtml('form.additional.info'); ?>

While most of the above are clear, I am struggling to understand the use of the below line

   <?php echo $this->escapeHtml($this->getUsername()) ?>

Why couldn't I have just done

  <?php echo $this->getUsername()?>

If it is a blank form that is seeking input, then what is being echoed?

Thanks for the help


texts: Add Custom Field to Billing Address Form on Admin and API - Magento 2

texts:
I tried few things but it didn't fully worked.

I need to create a custom field to Billing Address on "Create Order" page on Admin Panel.
And the result of this field should appears on "orders" API.

All my tests didn't saved the result and didn't show on API.

Anyone could help me with this ?

Thanks.


texts: Magento 2 : Get payment additional data from frontend to backend always empty

texts:
Im creating a custom payment method on an Magento 2 website using SecurePay API.
SecurePay Iframe Tokenise credit card and I will need that token to process the payment.
So I follow many tutorials to add additional_data to payment but I never could get any data even with the Magento doc tutorial: devDocs

Here is my code :

securepay-method.js (in js/view/payment/method-renderer)

/**
     * Get data
     * @returns {Object}
     */
    getData: function () {
        var data = {
            'method': this.item.method,
            'additional_data': {
                'token': 'test'
            }
        };

        return data;
    },

DataAssignObserver.php (Observer)

<?php

namespace Appscore\SecurePay\Observer;

class DataAssignObserver extends AbstractDataAssignObserver
{
const TOKEN = 'token';

/**
 * @var array
 */
protected $additionalInformationList = [
    self::TOKEN,
];

/**
 * @param Observer $observer
 * @return void
 */
public function execute(Observer $observer)
{
    $data = $this->readDataArgument($observer);

    $additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
    if (!is_array($additionalData)) {
        return;
    }

    $paymentInfo = $this->readPaymentModelArgument($observer);

    foreach ($this->additionalInformationList as $additionalInformationKey) {
        if (isset($additionalData[$additionalInformationKey])) {
            $paymentInfo->setAdditionalInformation(
                $additionalInformationKey,
                $additionalData[$additionalInformationKey]
            );
        }
    }
}

}

events.xml (etc)

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="payment_method_assign_data_securepay">
    <observer name="securepay_gateway_data_assign" instance="Appscore\SecurePay\Observer\DataAssignObserver" />
</event>

SecurePay (Model)

/**
 * Capture Payment.
 *
 * @param \Magento\Payment\Model\InfoInterface $payment
 * @param float $amount
 * @return $this
 */
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{

    $info = $this->getInfoInstance();

    var_dump($info->getAdditionalInformation());exit;
}

This always return :

array (size=1)
'method_title' => string 'Secure Pay' (length=10)

I tried everything, Im really lost on this problem, If someone can help me on this one that would be really helpfull

Thanks by advance !


texts: How to create a frontend form using Ultimate Module Creator

texts:
I am using an Ultimate Module Creator for one of the custom form on website where the form value is submitted from frontend and is stored and displayed in Magento backend.

I created a module using Module creator and was able to successfully create a backend form but didn't found an option to create the same form on frontend. Instead there is an option to display List and Detail page for the entered entries.

Can anyone please guide me how to create the form on frontend of the website using Module creator.


texts:
Best way to Migrate data from Magento 1 to Magento 2. I found below tools provided by Magento and some third party but don't know exactly which one to follow and what is the best way.

Magento tool: http://devdocs.magento.com/guides/v2.0/howdoi/migrate/migrate-data.html

Third party tool:  https://www.ubertheme.com/magento-news/magento-2-data-migration-tool/

  We need only the Data migration like order,products,customers,store
  configuration etc.

We did upgrade with third party tool but getting issues at store view level data at Magento admin side.

Any references or suggestion are highly appreciated. Thanks


texts: Magento 2 REST API returns only default category and its children

texts:
I am using "rest/V1/categories/" (Magento 2 Rest API). In documentation(devdocs.magento.com/swagger/#) it says "Retrieve list of categories" but it only returns default category(and its all children) every time. How can i get the list of all categories(those which are parent including default)

This is how i am doing it,

public function getCatagory($data){
        $response = array();
        if(isset($data['categoryId'])){
            $url = $this->baseUrl."rest/V1/categories/".$data['categoryId'];
            $response = $this->curlGet($url,$this->token);
        }else{
            $url = $this->baseUrl."rest/V1/categories/";
            $response = $this->curlGet($url,$this->token);
        }
        return $response;
    }

I am executing else part here "rest/V1/categories/" and i am getting,

{
  "id": 2,
  "parent_id": 1,
  "name": "Default Category",
  "is_active": true,
  "position": 1,
  "level": 1,
  "product_count": 0,
  "children_data": [

  ]
}

It only giving me default why are the other categories missing as shown in the attached image of admin panel. Please help!! Thanks i advance(I don't want to put all my categories under default as children, i know its a way out, but i have already made each of them a parent as they are shown in the images attached now i just want to fetch them).


texts: How to apply a catalog price rule in category and display name of catalog price rule in product view page in magento 1.9.2.4?

texts: How to implement this task I don't know .Can you please help me?


texts: Magento 2 - setup:install & setup:upgrade

texts: I have updated the code in my custom module and run setup:install already. Do I still need to run setup:upgrade?


texts: How to extend the topmenu.php block in magento2

texts:
I'm trying to extend the topmenu.php block to make some modifications but it doesn't work for me.
I already created my custom module.
Can someone help me by explaining how I can do it?


texts: Where is the product list page in magento blank theme

texts:
Hi I am building a theme based on magento blank theme . However I could not find any Product Listing page displaying a group of products with same categories.
Where could I find the code or Do I need to build it from scratch?


texts: Call a controller with multiple functions and cache this

texts:
I have a controller with 2 actions to show related products and related Boms of a product.

If I call first to related products function I have the related products but if I call now to related boms get the same result of last call ajax of related products.

If I call first to related boms I haven't items but if I call now to related products get the same result of last call, no data.

Is this Cahce issue ?

Any guide will be appreciated.


texts: Huge pdo_mysql.log - turning off logging doesn't stop it from growing

texts:
Magento is logging SQL queries even after I turned logging off in /lib/Varien/Db/Adapter/Pdo/Mysql.php. Wondering if there's something I'm missing?

These are the spots that are set to false:

    protected $_debug               = false;

/**
 * Minimum query duration time to be logged
 *
 * @var float
 */
protected $_logQueryTime        = 2.5;

/**
 * Log all queries (ignored minimum query duration time)
 *
 * @var bool
 */
protected $_logAllQueries       = false;

/**
 * Add to log call stack data (backtrace)
 *
 * @var bool
 */
protected $_logCallStack        = false;

/**
 * Path to SQL debug data log
 *
 * @var string
 */
protected $_debugFile           = 'var/debug/pdo_mysql.log';

I need to regularly delete var/debug/pdo_mysql.log or it will grow to several gigs in size.

Debug mode is disabled in the admin area (System - Configuration - Developer - Debug set to no).

Looking for some advice.
Thanks in advance


texts:
Magento 2 store email is not working.
Order, new customer, forget password.

Please help to find the solution.

Thanks.


texts: Magento 2 After updating the admin URL getting 404 Not found page

texts:
I have changed the admin URL using the below command line:

php bin/magento setup:config:set --backend-frontname="admin_path"

I have followed the below answer for change the admin URL:

How to change magento2 admin url?

After that I have gone to check the admin URL stored correct or not in this file
app/etc/env.php .

Also, I have run these commands after update the URL

php bin/magento setup:static-content:deploy
php bin/magento cache:c
php bin/magento cache:f

The URL has changed as expected but now I am getting 404 Not Found page when I go the updated admin URL.

Please suggest if anyone faced this issue in past.


texts: No action triggered after placing an order

texts:
I am making my custom payment method module for Magento 1.9.1.1 and I want to do some action when user proceeds to checkout, before the order is placed, and after the order is placed. I implemented action for proceed to checkout event, and then I wanted to add an observer for event when order is placed. In my config.xml file I have this:

<events>
  <controller_action_predispatch_checkout_onepage_index>
    <observers>
      <mycheckout>
        <class>Custom_Paymentmethod_Model_Observer</class>
        <method>checkoutStarted</method>
        <type>singleton</type>
      </mycheckout>
    </observers>
   </controller_action_predispatch_checkout_onepage_index>
   <sales_order_save_after>
     <observers>
       <mycheckout>
         <class>Custom_Paymentmethod_Model_Observer</class>
         <method>initiateCheckout</method>
         <type>singleton</type>
       </mycheckout>
      </observers>
    </sales_order_save_after>
</events>

And in my Observer.php file I got:

class Custom_Paymentmethod_Model_Observer
{
    public function checkoutStarted(Varien_Event_Observer $observer)
    {
        //This action works fine
    }

    public function initiateCheckout(Varien_Event_Observer $observer)
    {
        //Nothing from here is triggered
    }
}

What am I missing here, and what is the issue?

And what event should I use before the order is placed?


texts: Magento 1.9 : Class 'Mage_Creditmemoexport_Helper_Data' not found

texts:
I am creating a module for exporting Creditmemo data in xml but I am getting following error.
I have checked everything but I am unable to find the bug please help me.

Config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Ninobambino_CreditmemoExport>
            <version>1.0.0</version>
        </Ninobambino_CreditmemoExport>
    </modules>
    <global>
        <helpers>
            <Ninobambino_CreditmemoExport>
                <class>Ninobambino_CreditmemoExport_Helper</class>
            </Ninobambino_CreditmemoExport>
        </helpers>
        <models>
            <Ninobambino_CreditmemoExport>
                <class>Ninobambino_CreditmemoExport_Model</class>
            </Ninobambino_CreditmemoExport>
        </models>
        <resources>
            <Ninobambino_CreditmemoExport_setup>
                <setup>
                    <module>Ninobambino_CreditmemoExport</module>
                </setup>
            </Ninobambino_CreditmemoExport_setup>
        </resources>
        <events>
            <sales_order_creditmemo_save_after>
                <observers>
                    <Ninobambino_CreditmemoExport_order_creditmemo_save_after>
                        <type>singleton</type>
                        <class>Ninobambino_CreditmemoExport_Model_Observer</class>
                        <method>creditmemoExport</method>
                    </Ninobambino_CreditmemoExport_order_creditmemo_save_after>
                </observers>
            </sales_order_creditmemo_save_after>
        </events>
    </global>
</config>

Data.php

<?php
class Ninobambino_CreditmemoExport_Helper_Data extends Mage_Core_Helper_Abstract
{
    const LOG_ENABLED_CONFIG_PATH = 'productimport/general_config/log_enabled';
    const LOG_FILE_NAME = 'creditmemoexport.log';
    /**
     * Utility function to log a message to the log file, if logging is enabled
     * @param string log message
     */
    public function log($message) {
        if (Mage::getStoreConfig(self::LOG_ENABLED_CONFIG_PATH)) {
            Mage::log($message, null, self::LOG_FILE_NAME);
        }
    }
}


texts: Collect the product and shipping price at the time of order processing

texts:
My requirement is to collect the payment at the time of order processing.
 When a customer is placing an order, he is allowed to choose the payment option as 'Billed Later', ie no other payment details are asked to enter during order creation.

The product price and shipment charges will be known only at the time of Order processing. So while processing the order,Admin should be able to choose the payment details such as credit card details of the customer.

We are not allowed to save the payment details of the customer in our site (Like Saved Credit card).

Is there any payment gateways or methods available in market to satisfy my requirement. ie collect the credit card details from customer during order placement and allowed to choose the details by admin during order processing.

Any idea?


texts: How to create csv comma separated list from an array in PHP

texts:
I need to place every category in a separate category column.

Like Category_1, Category_2, Category_3.....

        $categoryIds = implode('|', $product->getCategoryIds());//change the category separator if needed
        $cat_name = array();
        $cat_array = $product->getCategoryIds();
        for($k = 0; $k < count($cat_array); $k++)
        {
            $id =  $cat_array[$k];
            $cat->load($id);
            $cat_name[] =  $cat->getName();
        }
        $_cate_name = implode(',', $cat_name);

Full code

<?php
ini_set('memory_limit','2048M');
ini_set('max_execution_time',3600);
error_reporting(E_ALL | E_STRICT);
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
Mage::app();
    $products = Mage::getModel("catalog/product")->getCollection();
    $products = Mage::getModel("catalog/product")->getCollection();
    $products->addAttributeToSelect('mgs_brand');
    $products->addAttributeToSelect('manufacturer');
    $products->addAttributeToSelect('qty');
    $products->addAttributeToSelect('category_name');
    $products->addAttributeToSelect('name');
    $products->addAttributeToSelect('description');
    $products->addAttributeToSelect('short_description');
    $products->addAttributeToSelect('url_key');
    $products->addAttributeToSelect('price');
    $products->addAttributeToSelect('ean');
    $products->addAttributeToSelect('sku');
    $products->addAttributeToSelect('category_ids');
    //$products->addAttributeToFilter('status', 1);//optional for only   enabled products
    //$products->addAttributeToFilter('visibility', 4);//optional for   products only visible in catalog and search
    $fp = fopen('exports.csv', 'w');
    $csvHeader = array("Visible", "Brand", "Supplier", "NL_Title_Short", "NL_Title_Long", "NL_Description_Short", "NL_Description_Long", "NL_URL", "NL_Variant", "Price", "Price_Old", "Price_Cost", "Price_Unit", "Unit", "Tax", "Stock_Track", "Stock_Disable_Sold_Out", "Stock_Level", "Stock_Min", "Stock_Alert", "Article_Code", "EAN", "SKU", "Category");
    fputcsv( $fp, $csvHeader,",");
    $cat_name = array();
    $cat_array = array();
    $cat = Mage::getModel('catalog/category');
    foreach ($products as $product)
    {
        $brand = $product->getMgs_brand();
        $supplier = $product->getManufacturer();

        $qty = $product->getQty();

        $sku = $product->getSku();
        $name = $product->getName();
        $desc = $product->getDescription();
        $shortDesc = $product->getShort_description();
        $urlKey = $product->getUrl_key();
        $price = $product->getPrice();
        $ean = $product->getEan();
        $categoryIds = implode('|', $product->getCategoryIds());//change the category separator if needed
        $cat_name = array();
        $cat_array = $product->getCategoryIds();
        for($k = 0; $k < count($cat_array); $k++)
        {
            $id =  $cat_array[$k];
            $cat->load($id);
            $cat_name[] =  $cat->getName();
        }
        $_cate_name = implode(',', $cat_name);

        fputcsv($fp, array(
            'Y',
            $brand,
            $supplier,
            $name,
            $name,
            $shortDesc,
            $desc,
            $urlKey,
            'Product',
            $price,
            '0',
            '0',
            ' ',
            ' ',
            '21',
            'Y',
            'Y',
            $qty,
            '0',
            '5',
            ' ',
            $ean,
            $sku,
            $_cate_name

        )
        ,
        ","
        );
    }
fclose($fp);

?>


texts: Magento 2: Admin Order Date filter showing wrong result

texts:
I have been trying to filter admin order based on a date but getting the wrong result.

I have try to filter Purchase Date from: 03-03-2019 and to: 03-03-2019
Expected result: Filter result list should be show Purchase Date from: 03-03-2019 and to: 03-03-2019

Actual result: Filter result list showing Purchase Date Mar 4, 2019
I am using Magento ver. 2.2.4
Any help is appreciated. Thank you.


texts: Magento2 Add header and footer in checkout page in enterprise edition

texts:
Can anyone let me know how to add header and footer in checkout page in magento2? i have Magento Enterprise edition, i tried with below code in theme/checkout_index_index.xml but its not working:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="logo" destination="header-wrapper" before="-" />
        <referenceBlock name="minicart" remove="false" />
        <referenceContainer name="header.panel" remove="false" />
        <referenceBlock name="top.search" remove="false" />
        <referenceBlock name="catalog.compare.link" remove="false" />
        <referenceBlock name="catalog.topnav" remove="false"/>
        <referenceContainer name="footer-container"  remove="false"/>
    </body>
</page>


texts: Payment fee is not included in invoice amount

texts:
I have added some payment charge based on the payment mode chosen by customer.
Below is my config.xml

<sales>
            <quote>
                <totals>
                    <surcharge>
                        <class>ucs_surcharge/sales_quote_address_total_fee</class>
                        <after>subtotal</after>
                    </surcharge>
                </totals>
            </quote>
       </sales>
        <fieldsets>
            <sales_convert_quote_address>
                <surcharge>
                    <to_order>*</to_order>
                </surcharge>
                <base_surcharge>
                    <to_order>*</to_order>
                </base_surcharge>
            </sales_convert_quote_address>
            <sales_convert_quote>
                <surcharge><to_order>*</to_order></surcharge>
            </sales_convert_quote>
        </fieldsets>

Below is my code,

<?php
class Ucs_Surcharge_Model_Sales_Quote_Address_Total_Fee extends Mage_Sales_Model_Quote_Address_Total_Abstract{

    public function __construct()
    {
        $this->setCode('surcharge');
    }

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        parent::collect($address);

        $this->_setAmount(0);
        $this->_setBaseAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this; //this makes only address type shipping to come through
        }

        $session  = Mage::getSingleton('checkout/session');
        $quote_id = $session->getQuoteId();

        if($quote_id){

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

            try{

                    $charges = 0.02;
                    $subTotal = $address->getFeeAmount()+$quote->getSubtotal();

                    $charges = 0.02*$subTotal;

        Mage::log('Calculation'.$charges, null, 'Ami.log');
                    $address->setSurcharge($charges);
                    $address->setBaseSurcharge($charges);

                    $quote->setSurcharge($charges);

                    $address->setGrandTotal($address->getGrandTotal() + $address->getSurcharge());
                    $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseSurcharge());
                }
        }

    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        if ($address->getSurcharge()) {
            $address->addTotal(array(
                    'code'=>$this->getCode(),
                    'title'=> 'Surcharge',
                    'value'=> $address->getSurcharge()
            ));
        }
        return $this;
    }
}

But using this my invoice amount is not adding this surcharge. That shows only previous amount.


texts:
I would like my Magento 2 shop to be accessible only via HTTPS. So I added this line to the Apache2 config file:

Redirect / https://www.domain.com/

The issue is that now the backend can't be accessed. Here is the error message:

domain.com redirected you too many times.


texts: Magento2: How to overwrite vendor/magento/module-configurable-product/view/frontend/templates/product/view/type/options/configurable.phtml

texts:
Magento2: How to overwrite

/var/www/html/vendor/magento/module-configurable-product/view/frontend/templates/product/view/type/options/configurable.phtml


texts: Magento 2: how can I remove columns in exported csv from order grid?

texts:
I want remove columns while exporting order grid data in magento 2. I google it but didn't find solution. Like I want to remove these fields from exported csv.

Payment Method
Total Refunded
Customer Group
Grand Total (Base)
Purchase Point


texts: Apply coupon code only to non discounted products

texts:
I need to make a coupon code which should be applied only to non-discounted products and certain categories. In Cart price rules->Actions I tried the following conditions:

If ALL  of these conditions are TRUE :
Special Price  is  0
Category is not one of  727, 777, 1379, 1380, 778, 111...

However, the coupon is getting applied to discounted products also.


texts: Magento url redirect problem ... Admin is not opening

texts:
I wanted to redirect my website now www to www ... lookied into some help and then went and made fallowing changes

System > Configuration menu and from the left panel click the "Web" button.

Unfold the "Unsecured" set of options and change the "Base URL" option from http://yourdomain.com to http://www.yourdomain.com.

after that non of my pages are openning ... infact admin is also not opening as its getting redirected ....

Please help ...


texts: Magento -> multiple locales for the same language - different websites

texts:
I have store with multiple websites (different domains). I use one theme, that has different colors/images using:
skin/frontend/default/theme1_blue
skin/frontend/default/theme1_red
skin/frontend/default/theme1_orange
all code is shared on the sam app/code/ dirs.

How to achieve different translations based in skin directories ? translation.csv is based on shared app/code/locale dir, but is it possible to load different translation.csv files based on skin version is used or store view is used ?

Thanks for help
Tomek


texts: Update Const template at Magento 2 Class

texts:
I need to update a template defined in a Constant at Configurable Class(Magento/Swatches/Block/Product/Renderer/Configurable.php).

I tried with a Plugin, but how the function which gets the constant is protected, I can't update the Constant correctly.

Anyone knows the correct way to update this constant or rewrite the function to change the path to my Module template.

  const CONFIGURABLE_RENDERER_TEMPLATE = 'Magento_ConfigurableProduct::product/view/type/options/configurable.phtml';

  protected function getRendererTemplate()
     {
         return $this->isProductHasSwatchAttribute ?
             self::SWATCH_RENDERER_TEMPLATE :
             self::CONFIGURABLE_RENDERER_TEMPLATE;
     }


texts: magento2 - How to add Details field for Custom option in admin?

texts:
magento2 How to add Details field for Custom option in admin?

How can i add new custom field in custom option admin side in magento 2?
Like magento 1 following link http://magento.ikantam.com/qa/how-add-custom-attributes-custom-options

Thanks..


texts:
In magento 1.9 how can i show unit price of product in cart & checkout excluding tax?

In cart

Price of product (without tax) + Tax (seperately) = grand total.

currently in my cart price contains tax.

Any help will be appreciable..


texts: Magento2: How to disable admin category page cache in magento2

texts:
I need to disable admin category cache page in magento2

Thanks


texts: How to create & store custom cache in magento 1?

texts:
I am trying to create & store custom cache using script in magento 1.
Is their any way we can implement it ?


texts:
I have an observer who changes the price of the items and at the end of the routine the whole order changes, but on my cart edit screen the subtotal of the item still keeps the old price of the item, how can I fix this?

The functions used to make the change are:

$itemcarrinho->setCustomPrice($temp);
$itemcarrinho->setOriginalCustomPrice($temp);
$itemcarrinho->getProduct()->setIsSuperMode(true);
$itemcarrinho->save();

$quote->setSubtotal($total)
->setBaseSubtotal($total)
->setGrandTotal($total)
->setBaseGrandTotal($total);
$quote->save();

Magento 2.3.5


texts: Magento 2: How can create model without extends any class

texts:
I am creating a model but when I print class object showing blank? Why

namespace Pwa\Pay\Model;
use \Magento\Framework\App\Config\ScopeConfigInterface;
class AbstractModel  {
    protected $_appConfigScopeConfigInterface;
    public function __construct(
        ScopeConfigInterface $appConfigScopeConfigInterface)
    {
        $this->_appConfigScopeConfigInterface = $appConfigScopeConfigInterface;
    }
    public function hello(){
        echo get_class($this->_appConfigScopeConfigInterface);
    }
}


texts: Is it good to instantiate a getModel class on phtml templates?

texts:
This is a question regarding a good programming practices in Magento.

I need to show (in the category product list) the product with its related products in thumbnails. So I edited mypackage/mytheme/template/catalog/product/list.phtml with something like this

<?php
    $related=$_product->getRelatedProductIds();
    if(count($related)>0){
        echo '

';
        echo '

';
        foreach($related as $rela){
            $rela_nom=Mage::getModel('catalog/product')->load($rela);
            echo '
getProductUrl().'"> helper('catalog/image')->init($rela_nom, 'small_image')->resize(20).'" width="20" height="20">
';
        }
        echo '

';
    }
?>

And it works very well.

But my question is: Is this correct to instantiate a model class on the phtml files?

If is not, what would be the best way to achieve this functionality? I mean, what file is better to edit or what class is better to add, where? A helper?

Can you provide a little example or give me a glance of what files are better to edit.


texts: Client side less compilation not working

texts: I am facing a problem when I select an option from magento backend for frontend development workflow to "Client side less compilation". After selecting it says less files are not accesiible 403 error. Something like forbidden. I had tried to run command for static deployment but it did not work. Also tried clearing out pub/static folders inside it, but couldn't work. Any ideas how to resolve?


texts: How to get selected custom options on onepage

texts:
I want to get only those custom options which are selected by the customer on the product page. while I am on the onepage page, so I have the quote object.

$items = $quote->getAllItems();
foreach ($items as $item) {
    //getting selected custom options
}


texts: Magento2 sort products and search result by stock availability

texts:
I need to add an option in the Sort By dropdown which sorts the products with based on stock availability of the products.

So far i have created a plugin for setCollection methodMagento\Catalog\Block\Product\ProductList\Toolbar.
Check the following code i am using to apply the sort order

public function afterSetCollection($subject)
    {
        $selectedDirection = strtolower($this->_toolbarModel->getDirection());

        if($this->_toolbarBlock->getCurrentOrder() == 'stock'){
            $collection = $subject->getCollection();
            $collection->addAttributeToSort('is_in_stock',$selectedDirection);
            $collection->getSelect()->joinLeft(
                ['_inventory_table' => 'cataloginventory_stock_item'],
                "_inventory_table.product_id = e.entity_id",
                ['is_in_stock']
            );
            $collection->getSelect()->order('is_in_stock',$selectedDirection);
            $collection->setOrder('is_in_stock',$selectedDirection);
            /*echo $collection->getSelect();die;*/
        }
        return $subject;
    }

When i print the sql query, it shows the Order By clause applied and if i execute it, it generates correct results, but the product list in the list page does not reflect the same order.


texts: Cannot "Update Attributes" of more than 999 products

texts:
I've migrated to a new server, all magento files have remained the same. The only difference is that I am using CentOS 7 and MariaDB as apposed to CentOS 6.5 and MySQL.

When selecting "All" products (60k) --> Update Attributes when saving the message Total of 999 record(s) were updated*

This is despite having selected "All" with the correct number of products selected.

EDIT: This is obviously not an isolated problem: https://stackoverflow.com/questions/15497123/magento-why-cant-i-update-all-products-from-admin-grid

What steps can be taken to trouble shoot and resolve this issue?


texts: Get custom values from sales_flat_order_item table in magento?

texts:
Get custom values from sales_flat_order_item table in magento 1.9

Anyone have idea please help


texts: Display different currency depending on product, Magento

texts:
I manage a store and we have products from multiple vendors. Some vendors are selling in USD, some in EURO, so in my store, for some products I will need to display the price in EURO and for others I will need to display it in USD.

I have one store with one view and the base currency is RON, our local currency as our customers want to be invoiced and pay in their currency. I did the multi currency set up, selected the 3 currencies that I need, set the currency symbols and rates, but I don't know how to show different currencies in the frontend as well.

Is there a way to select the currency of display for each product when I am adding it? I was thinking that multiple views would solve this issue, but I am not sure if this would work. I am using Magento ver. 1.9.4.2.

If you have any suggestions, they are more than welcomed. Thank you in advance!


texts:
I want to upgrade existing shop from 1.8.1.0 to 1.9.3.2

What are the steps should be followed to accomplish this work?


texts:
I've written a module with a config section that saves it's data as a serialized array.

After having tested the module and making sure it works, I want to also include default data so that nothing needs to be set up after deploying the code to our live servers.

However, I am having a lot of trouble with setting the default data.

I've removed the stored config data from core_config_data, and have added a serialized array to the module's config.xml like this:

<template_associations><![CDATA[a:3:{s:6:"method";a:7:{i:0;s:12:"banktransfer";i:1;s:12:"banktransfer";i:2;s:12:"banktransfer";i:3;s:13:"peach_payment";i:4;s:13:"peach_payment";i:5;s:6:"rcspay";i:6;s:6:"rcspay";}s:6:"status";a:7:{i:0;s:10:"processing";i:1;s:19:"pending_eft_payment";i:2;s:10:"in_transit";i:3;s:10:"processing";i:4;s:10:"in_transit";i:5;s:10:"processing";i:6;s:10:"in_transit";}s:8:"template";a:7:{i:0;s:1:"7";i:1;s:1:"6";i:2;s:1:"8";i:3;s:1:"5";i:4;s:1:"9";i:5;s:1:"5";i:6;s:1:"9";}}]]></template_associations>

I've tested and made sure that the serialized array used for the default data is correct, and I know the path in the config.xml is correct because I have other default data that is taking effect, but the serialized array is not taking effect at all. I've also made sure that my configuration data cache is disabled.

Is there anywhere else I need to update to make sure that my instance of Magento reverts to loading the default data for this section? Should I change something about the default data itself? (I've tested with CDATA tags and without, with no success).


texts: I want to add 'Business name' field to billing and shipping address form in creating new customer while creating new order from admin. How can I do that?


texts: How to create REST API to upload image into customer custom fields

texts:
I am using Magento Enterprise Solution. Where I have created a few custom fields (File Type) for a customer.
I want to get help to create REST API to upload an image into these fields by using REST API's
Thanks in advance for your kind help.


texts: Magento controller only executing once - cannot disable cache

texts:
I have a controller that only executes once after the cache is cleared. After that the response is always the same - cache is there instead of a new execution.

The class is extends\Magento\Framework\App\Action\Action:

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

What can I do inside this controller to get rid of the cache activity?

This is not related to any block, meaning that it cannot be done via xml cacheable=false option.

Thank you !


texts: How do I implement store switcher through controllers?

texts:
How do I implement store switcher through controllers instead of using block template to implement store view like this:

<forum_admin_adminhtml_forum_edit>
    <reference name="left">
         <block type="adminhtml/store_switcher" name="store_switcher" template="store/switcher.phtml" />
    </reference>
</forum_admin_adminhtml_forum_edit>

How can I implement store switch through controllers?


texts: How can I Send a Magento order to third-party API when placed

texts:
I'm trying to send sales orders to third-party API from magento website.once a customer submitted order should be call this API and if order cancel or reorder should be call this API. Is there way to do this in magento?

How and where will it get triggered?


texts: How to add static pages in the Magento 2 search result?

texts:
I'm using a Magento 2.4 and in my project I have many static pages that I would like to be part of my search results.

How could I add Magento 2 static pages in my search results?


texts: Magento 2.3 MSI Custom Product Type, Stock Tracking, and Product Category Collection Filtering?

texts:
I need to create a custom product type that has custom stock functionality and does not behave like a simple product, bundle, or configurable.

To build out this product type I need to understand how Magento 2.3 with product category stock filters work (and indexers) and how product types are tied to stock models.

I have tried looking at the Magento Catalog module and can see where category product collection is made but not how it filters for stocks vendor/magento/module-catalog/Block/Product/ListProduct.php:485
and the UML diagram here: https://github.com/magento/inventory/wiki/New-Indexer-for-StockItems as well as how the simple and bundle product types are setup.

So basically when and where does stock checking happen, where are the stock models tied to products, where are the stock checks done when viewing a product category on the front-end, and how can I make my own models for a new product type? Also are indexers used for these checks?

PS are there any UML architectural diagrams for classes and how they interact besides the very high level ones on Magento Docs site?


texts:
I'm trying to override the Catalog/Product/View/Options/Type/Select.php class so I can change the initial placeholder text from: -- Please Select -- to Choose Size. My custom module is recognized within the admin (and is enabled) and all files seem to have the right code but I'm not seeing the text replaced.

Can anyone see what I'm doing wrong? Any advice would be very helpful!

Here is my app/etc/Override_Catalog.xml file:

<?xml version="1.0"?>
<config>
    <modules>
        <Override_Catalog>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_Catalog />
            </depends>
        </Override_Catalog>
    </modules>
</config>

Then the app/code/local/Override/Catalog/etc/config.xml file:

<?xml version="1.0"?>
<config>
    <global>
        <blocks>
            <mymodule>
                <class>Override_Catalog_Block_Product_View_Options_Type</class>
            </mymodule>
            <catalog>
                <rewrite>
                    <select>Override_Catalog_Block_Product_View_Options_Type_Select</select>
                </rewrite>
            </catalog>
        </blocks>
    </global>
</config>

And lastly the class file:

<?php
    class Override_Catalog_Block_Product_View_Options_Type_Select
        extends Mage_Catalog_Block_Product_View_Options_Type_Select {

        # I only override the placeholder text, everything else remains intact.
    }


texts: Meta description is not updating in old products - Magento ver. 1.9.3.2

texts:
I'm trying to update meta description from the backend but when I save it... it got blank again.
I tried to import meta tags through excel sheet. But again I found the description text area blank.

Please help me out ASAP


texts:
my website shows below error in front page

Fatal error: Class 'Mage_Xsitemap_Helper_Data' not found in /home/***/public_html/app/Mage.php on line 547

any idea how to solve this error?

Thank You


texts:
How can I get date of tomorrow in Magento2?
I can use below code to get current date but I couldn't fetch the date of tomorrow.
// $this->datetime \Magento\Framework\Stdlib\DateTime\DateTime $datetime
// $this->timezone \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone

 $currentDay = $this->timezone->date($this->datetime->date('+1day'))->format('Y-m-d');


texts: Magento 2: Migration of orders in multistore

texts:
we are migrating data from older magento 1.9 store zu a new one with Magento 2.3
Migration works like a charme by following instructions from here: Magento 2: Migrate only Customer and orders
We have a multistore system and the existing orders come from different stores.
Orders of the default store in 1.9 are being transferred to the default store in 2.3
Is there any configuration of data-migration-tool to define which old store is the equivalent in Magento 2.3? What is the identifier for the allocation?
Thanks for your help
Kind regard


texts: how to use curl for external api call in magento 2

texts: How do I make a post request with curl without using a button, but instead calling the external API when a field is filled out


texts: How Redirect to 3rd party payment gateway in Magento2?

texts:
In Magento 1 we define the getOrderPlaceRedirectUrl in the model which extends Mage_Payment_Model_Method_Abstract and redirect to a particular controller after checkout submit.

Then from the controller we call $this->getResponse()->setBody($this->getLayout()->createBlock('someblock')->toHtml()) and inside the block we create a form with post data and redirect to a 3rd party payment gateway.

In Magento 2 I heard that getOrderPlaceRedirectUrl is not available and I'm unable to understand how it is handled.

Can someone please guide me to achieve the above scenario in Magento 2.1?


texts:
we want to import group products in our website through CSV ,
Pleas guide us what will be the format of CSV to import group products.


texts: shipping method timer so  customers can get this shipping method every 1 hours after latest client use this method .


texts: Trying to do a Fresh installation of the magento 2.0

texts:
After enabling the local.xml in the pub folder I got the below error

Missing required argument $routerList of Magento\Framework\App\RouterList.

I tried everything which is mentioned in the link
in github magento2 issues

but still experiencing the same issue. Any guidance will be of greate help.


texts:
I just have a question about the migration process from M1 to M2.

Run the data migration tool.
Test thoroughly on the new M2 store
Run the incremental migration tool.
Switch to new M2 store.

Can orders, products, customers be added at #2 on the new M2 store?

Will it screw up the incremental migration tool if that is done?

This is a big question because client will likely want to test thoroughly and count span a couple / few days.


texts:
I have a store with two websites: B2C and B2B. In a product I setup a tier price fore the B2B website. This tier price shows up in the product page but not in cart.

If I set the tier price to all websites it works also in the cart. In catalog_product_index_tier_price and catalog_product_index_price it looks fine to me. Reindexing and clearing cache did not help.

How do I debug this?


texts: magento 2 error message for wrong login?

texts:
when a customer enters the wrong password my site just refreshes the login page without any error message. Is there a way to redirect and/or display an error messaging saying something like the wrong password was entered?
thanks!


texts: How to call Magento 2 custom variables in phtml file?

texts:
I have created custom varibles in "System -> Other Settings -> Custom Variables" for different store views.
How can i call them in phtml files for store views?
I am trying following code but its not working
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$model = $objectManager->get('Magento\Variable\Model\Variable')->loadByCode('storenumber');
$plain_value = $model->getPlainValue();

?>

<?php echo $plain_value ?>


texts: Magento 2: Add custom module JavaScript code in head tag

texts: My requirement is to append magento 2 custom module JavaScript code inside the <head> tag for all the web pages.


texts: How to overwrite crosssell template in custom module?

texts:
I am trying to display custom information for cross-sell items. I want to overwrite app/design/frontend/base/default/template/checkout/cart/crosssell.phtml

and use a new template in my module. I've tried a couple of ways to no avail. Here is my code:

in my config.xml

<frontend>
    <layout>
        <updates>
            <crosssellAttributes_layout module="CrosssellAttributes">
                <file>crosssellattributes.xml</file>
            </mymodulename_layout>
        </updates>
    </layout>
</frontend>

and in my layout modulename.xml

<?xml version="1.0"?>
<layout>
<checkout_cart_crosssell>
    <reference name="checkout.cart.crosssell">
        <block type="napkinstudio_productcrosssell/catalog_product_view_crosssell" name="product.view.crosssell" as="crosssell" template="[templatename]/productcrosssell.phtml" />
        <action method="setTemplate">
            <template>[templatename]/productcrosssell.phtml</template>
        </action>
    </reference>
</checkout_cart_crosssell>

I want it to point to my child theme file, but can't seem to get it right. Any pointers would be greatly appreciated! Thank you.


texts: How to add column to product grid magento 2?

texts: How to add column to product grid magento 2 ?


texts: Magento 2.3.3 Address update at checkout shows some Weird thing

texts:
I have attached the screenshots here,
On checkout page customer is login, when I select first address and click on update, shows like this, anyone has idea about it? This is default braintree payment gateway configured.


texts: How can the Magento caches & logs be cleared?

texts: How can I go about clearing all of Magento's caches and logs by running a PHP script?


texts: Check locale of current website Magento 2

texts:
I need to check with php if the currently displayed website is the main one in ENGLISH or it is in INDIAN or ARABIC. How can I do that?

I've searched around but didn't found anything.

in Magento 1 it was super easy

$locale = Mage::app()->getLocale()->getLocaleCode();

if ($locale == 'en_EN') { ... }


texts: Showing magento shipping cost, gift wrap cost, and total in checkout success page

texts:
actually i want to show shipping cost, gift wrap cost, and order total amount in checkout success page, found that success.phtml file, but not sure to type the code, anyone experience with it ?

currentlly just found the subtotal

<?php echo Mage::helper("core")->currency($order_details->subtotal) ?>

Thanks


texts:
I accidentally deleted the vendor folder in my Magento 2 installation and I'm getting an autoload error and I also noticed that the env file is missing, is there any way to solve the problem ?
I also read that I can do composer install but will that affect my data ?
Thanks.


texts: Detailed product page urls are hard to understand - Magento 1

texts:
When i go to the link

http://www.millefirme.com/shop/uomo.html

Click on a product to go to the link

http://www.millefirme.com/shop/catalog/product/view/id/2/s/giubbino-con-zip-in-contrasto-cappuccio/category/4/

This is a pretty long url.
I want to get back to it with .html
Please help me.


texts: Links produce 404 Error because wrong language

texts:
We have a magento store with two languages, german and english. The store default is english  and we have two different URL Keys depending on the language, for example:
English: www.domain.de/red-long-car.html
German: www.domain.de/rotes-langes-auto.html

So if someone types in the german link he goes to the default english store and then gets an 404 error.
Is there a way that Magento can redirect him to the german store without giving an 404 error.

Thanks


texts: I am gettig all my catagorries and subcatagories in json string,but I want only active catagories in my json string

texts:
class Ab_CategoryObserver_Model_Observer
{
    public function updateTopMenuJson(Varien_Event_Observer $observer)
    {
      $_helper = Mage::helper('catalog/category');
      $_categories = $_helper->getStoreCategories();
      $recursionLevel = 3; // Add recursion level
      $storeId = 1; // Add your Store ID for which you want to get category tree
      $node = '';
      $categoryTreeData = $this->getCategoryTree($recursionLevel, $storeId);
      $arr = json_encode($this->getCategoryTree(3));
      file_put_contents("cat_node.json", $arr);
    }

    protected function getCategoryTree($recursionLevel, $storeId = 1)
    {
        $parent = Mage::app()->getStore($storeId)->getRootCategoryId();
        $tree = Mage::getResourceModel('catalog/category_tree');
        /* @var $tree Mage_Catalog_Model_Resource_Category_Tree */

        $nodes = $tree->loadNode($parent)
            ->loadChildren($recursionLevel)
            ->getChildren();
        $tree->addCollectionData(null, false, $parent);

        $categoryTreeData = array();
        foreach ($nodes as $node) {
            $categoryTreeData[$node->getData('entity_id')] = $this->getNodeChildrenData($node);
        }

        return $categoryTreeData;
    }

    protected function getNodeChildrenData(Varien_Data_Tree_Node $node)
    {
        $categoryData = array(
          'title' => $node->getData('name'),
          'url'   => $node->getData('url_key'),
          'id'    => $node->getId(),
          // 'mega_menu1'=> $node->getData('mega_menu')
          'mega_menu'=> 'false'
        );

        foreach ($node->getChildren() as $childNode) {
          if (!array_key_exists('children', $categoryData)) {
              $categoryData['mega_menu'] = 'true';
              $categoryData['children'] = array();
          }

            $categoryData['children'][$childNode->getData('entity_id')] = $this->getNodeChildrenData($childNode);
        }
        return $categoryData;
    }
}


texts: Where do I specify the file path for phtml? (Clarification please)

texts:
Where do I put the phtml file that all of this works with?

Current Files and their folder structure:
app/code/local/Sean/Customform/controllers/IndexController.php

<?php
class Sean_Customform_IndexController extends Mage_Core_Controller_Front_Action{
    public function indexAction(){ //this will display the form
        $this->loadLayout();
        $this->_initLayoutMessages('core/session'); //this will allow flash messages
        $this->renderLayout();
    }
    public function sendAction(){ //handles the form submit
        $customer = Mage::getSingleton('customer/session')->getCustomer();
        $post = Mage::app()->getRequest()->getParams();

        $customer->setData('vendorMarkup', $post['vendorMarkup']);
        $customer->setData('vendorGramPrice', $post['vendorGramPrice']);
        $customer->setData('vendorGramFront', $post['vendorGramFront']);
        $customer->setData('vendorGramBack', $post['vendorGramBack']);
        $customer->setData('vendorDefaultCalc', $post['defaultMarkup']);
        $customer->save();

        Mage::getSingleton('core/session')->addSuccess($this->__('Your Calculator Preferences Are Updated!'));//add success message.
        $this->_redirect('*/*');
    }
}

app/code/local/Sean/Customform/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Sean_Customform>
            <version>0.0.1</version>
        </Sean_Customform>
    </modules>
    <global>
        <blocks>
            <customform><!-- block alias -->
                <class>Sean_Customform_Block</class>
            </customform>
        </blocks>
        <helpers>
            <customform><!-- helper alias -->
                <class>Sean_Customform_Helper</class>
            </customform>
        </helpers>
    </global>
    <frontend>
        <routers>
            <customform>
                <use>standard</use>
                <args>
                    <module>Sean_Customform</module>
                    <frontName>customform</frontName><!-- url key for module -->
                </args>
            </customform>
        </routers>
        <layout>
            <updates>
                <sean_customform>
                    <file>sean_customform.xml</file><!-- frontend layout file -->
                </sean_customform>
            </updates>
        </layout>
        <translate>
            <modules>
                <Sean_Customform>
                    <files>
                        <default>Sean_Customform.csv</default><!-- translation file (not mandatory) -->
                    </files>
                </Sean_Customform>
            </modules>
        </translate>
    </frontend>
</config>

app/code/local/Sean/Customform/helper.Data.php

<?php
class Sean_Customform_Helper_Data extends Mage_Core_Helper_Abstract{
}

And of course, app/etc/modules/Sean_Customform.xml

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


texts: I am new to Magento and I accidentally deleted a product prior to disabling the product on a store.  While you are not able to purchase the product as when you select the product from the products listings it says product is unavailable.  But the product is showing on the product listings page and I need to remove that but am uncertain how as I cannot find the product and then disable it for that page.


texts: How to reference the customer account navigation container block which doesn't have a "name" or "as" attribute in Magento 2?

texts:
As the title says, how can I reference a layout block which doesn't have a "name" or "as" attrbitue?

Specifically, I'm trying to reference the Customer Account menu and add a title argument in customer_account.xml.

Here's the title argument which I'm trying to add:

<argument name="block_title" xsi:type="string">User account</argument>

to:

<block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/collapsible.phtml" before="-">
    <arguments>
        <argument name="block_css" xsi:type="string">account-nav</argument>
    </arguments>
    ... more code here ...
</block>

Not sure how to go about this, except to edit the vendor customer_account.xml. Which is something I'd rather not do...


texts: Classes instantiated outside of the ObjectManager

texts: What classes are instantiated outside of the ObjectManager so that they can't be customized in di.xml ?


texts: Parse error: syntax error, unexpected ' { '

texts:
I probably know that this is something really simple, but I can not figure out what is wrong with my code. I got this

    $this->_addButton('Generate', array(
        'label'     => Mage::helper('adminhtml')->__('Generate'),
        'onclick'   =>  jQuery.ajax({url: "Mage::helper('adminhtml')->getUrl('adminhtml/generate/generate/')",
                  method: 'GET',
                  data: {},
                  success(function()
                  { alert ('Generation Successful!'); }),
                  error(function()
                  { alert ('Generation Failed!'); }),
     }),
    ), -1);

And I am getting this error:  Parse error: syntax error, unexpected '{' in C:\wamp64\www\app\code\core\Mage\Adminhtml\Block\Widget\Form\Container.php on line 68

Any help please?


texts: override the module-list.phtml by theme list.phtml

texts:
please visit link1 , in listing page 4 images are displaying.

we needed "pre-order" feature [ user can buy out-of-stock Products ]

so we wrote custom module , after listing page looks like link2

module-list.phtml is overriding theme-list.phtml

we want to re-override  module-list.phtml by the theme list.phtml

i can delete module-list.phtml , but after that list.phtml will not visible

Edit

there is some problem with links when visit 1st time. please copy below url in browser tabs urls :

http://sb1.collagekingapp.com/apple.html


texts: Apple pay and Google Pay for the UAE (Currency AED)

texts:
For the Magento 2, Which extension is best for the Google Pay and Apple Pay for the UAE (currency AED)?
Please suggest the Extension provider and payment gateway.


texts: Page Styling (css) does not appear in the new Theme implementation (descendant of Luma Theme)

texts:
I just created empty theme which is descendant of Luma theme. but unfortunately the styling is not appear:

theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Senheng Theme</title>
    <parent>Magento/Luma</parent>
    <media>
        <preview_image>media/preview.png</preview_image>
    </media>
</theme>

registration.php

<?php

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Senheng/default', __DIR__);

Folder Structure

Pending requests, takes minutes to be done.

Could somebody help me how to fix this issue ?
Any help would be very appreciated.


texts: Magento 2.3.1 Inventory reservations cleanup not working

texts:
Even though cron job seems to be working fine, it does not cleanup the inventory_reservation table.

This is the result I get back from the cron.log:

  [2019-06-03 00:00:11] main.INFO: Cron Job
  inventory_cleanup_reservations is successfully finished. Statistics:
  {"sum":0.0029830932617188,"count":1,"realmem":0,"emalloc":70656,"realmem_start":161742848,"emalloc_start":160341872}
  [] []

It has no effect on store but I still would like to fix this. What could be the problem?


texts: update website_id and store_id using sql command

texts:
i'm going to move all customers to one site from an other site, i planned to use sql command to do this
Update customer_entity set website_id = 4 where website_id = 3

but when i ran this command, there is an error
1062 - Duplicate entry 'someone@email.com-4' for key 'UNQ_CUSTOMER_ENTITY_EMAIL_WEBSITE_ID'
there is an email duplicated and a unqiue key disallowed me to perform this action.
Any ideas to solve this?
Re:i run the script but there is an error
Fatal error: Uncaught exception 'Mage_Customer_Exception' with message 'This customer email already exists' in /home/prd1/public_html/app/Mage.php:580 Stack trace: #0 /home/prd1/public_html/app/code/core/Mage/Customer/Model/Resource/Customer.php(99): Mage::exception('Mage_Customer', 'This customer e...', 3) #1 /home/prd1/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1122): Mage_Customer_Model_Resource_Customer->_beforeSave(Object(Mage_Customer_Model_Customer)) #2 /home/prd1/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Eav_Model_Entity_Abstract->save(Object(Mage_Customer_Model_Customer)) #3 /home/prd1/public_html/au_asia.php(16): Mage_Core_Model_Abstract->save() #4 {main} thrown in /home/prd1/public_html/app/Mage.php on line 580


texts: Add A Block To An Existing Tab Programmatically

texts:
I'm trying to add a block to an existing tab on the product view page in Magento, programmatically.

The tab is the pre-existing description tab, around line 185 of the catalog xml file at app/design/frontend/base/default/layout/catalog.xml

<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
    <action method="setTitle" translate="value"><value>Description</value></action>
</block>

I'm using a custom module and trying to inject my block after the description content, in the same tab. Here's the code:

class My_Details_Block_Product extends Mage_Core_Block_Template
{
    protected $_template = 'details/product_details.phtml';

    protected function _prepareLayout() {
        if ($addToTabBlock = $this->getLayout()->getBlock('product.description')) {
            $addToTabBlock->insert($this, '', false, 'details');
        }
        return $this;
    }
}

There are no errors available in any of the logs, but the block simply doesn't appear. I've also tried to use the append method:

$addToTabBlock->append($this, 'other');

But get the same (blank) result.

How can I insert a block to the existing tab? Thanks.


texts: Create Simple Controller Not Working In my module

texts:
I am Trying To create a Simple Module. It's Found 404 page Error.

My config file in app/etc/module/dixit_featured.xml

      <?xml version="1.0"?>
         <config>
          <modules>
             <dixit_featured>
                <active>true</active>
                <codepool>local</codepool>
              </dixit_featured>
          </modules>
         </config>

Create Controllrer in app\code\local\dixit\featured\controllers\IndexController.php

    <?php
      class dixit_featured_IndexController extends Mage_Core_Controller_Front_Action
       {
           public function indexAction ()
           {
            echo 'test index';
           }
           public function mamethodeAction ()
           {
            echo 'test mymethod';
            }
        }
     ?>

And Create My Plugin xml file in app\code\local\dixit\featured\etc\config.xml

       <?xml version="1.0"?>
         <config>
            <modules>
               <dixit_featured>
                  <version>1.0.1</version>
               </dixit_featured>
             </modules>
    <frontend>
        <routers>
             <mymodule>
                <use>standard</use>
                <args>
                    <module>dixit_featured</module>
                    <frontname>dixit</frontname>
                </args>
             <mymodule>
        </routers>
    </frontend>
  </config>


texts: What is Magento 2's equivalent for 'required equals true' in system xml

texts:
In Magento 1, under your system config .i.e the system xml,  you could make a column a required column by doing this:

<required>true</required>

so the entire config could look like this:

  <config>
   <sections>
    <au translate="label" module="auth">
        <groups>
            <aug translate="label" module="auth">
                <fields>
                    <email_input translate="label">
                        <required>true</required>
                        email:
                        <frontend_type>text</frontend_type>
                        <sort_order>1</sort_order>
                    </email_input>
                </fields>
            </aug>
        </groups>
    </au>
</sections>

What is the Magento 2 equivalent?

I tried doing this:

<field id="au" translate="label" required="true"type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="1">
    email:
 </field>

I also tried this:

<field id="au" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="1">
    email:
    <required>true</required>
</field>

But both give errors


texts:
I tried for an hour, but I can't find the solution. I using sandbox account for paypal check out and I need express check out, credit and debit card and paypal account payment method, how can configured this. I got error after express or paypal.

  PayPal gateway has rejected request. Payment has already been made for this InvoiceID (#10412: Duplicate invoice)


texts: Add configurable product to existing quote_id programatically

texts:
Below code helps me to add configurable product to current cart session

    $quote_id = '4';
    $params = array(
        'product' => 1,
        'super_attribute' => array(
            132 => 3,
            133 => 8
        ),
        'qty' => 1,
    );
    $cart = Mage::getSingleton('checkout/cart');
    $product = new Mage_Catalog_Model_Product();
    $product->load(1);
    $cart->addProduct($product, $params,$quote_id);
    $cart->save();
    Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

In a similar way i want to add configurable product to my existing quote_id 4

I've tried

$cart = Mage::getSingleton('checkout/cart')->load(4);

But unfortunately it didn't worked. Any suggestion to make it work ?


texts: I am tired to find customer feedback in contact us form.Let me know where i can see contact us data in magento admin .


texts: Magento 2: Uncaught TypeError: Cannot read property 'items' of null for restricted permission user

texts:
Note: This is not a duplicate of any similar error

I have found a strange bug in Magento 2. It shows the following error in the browser's console for only restricted admin user (the user which has not full rights of the admin panel).

Uncaught TypeError: Cannot read property 'items' of null
    at UiClass.onRequestComplete (data-storage.js:270)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)
    at done (jquery.js:9840)
    at XMLHttpRequest.callback (jquery.js:10311)

To replicate the issue, follow the process below:

Login to the backend with a user with full backend permission.
Create a new user role from System >> User Roles with Custom Resource Access. For example, select only the Dashboard from the resources list. (You can choose any other)

After creating the role, create a new admin user with the role which you created in the previous step.
Login to the backend with new user's login credentials in another browser or after logging out the current user.
Open the browser's console and check the error mentioned above.

Note: I have noticed the same error from Magento versions 2.2.4 to 2.2.7.


texts:
I am trying to import bulk products in magento  using System -> Import/Export -> Dataflow – Profiles -> Import All Products and after uploading .csv file and clicking on run profile in popup i get a window which is showed in below snapshot. But the products are not getting displayed on magento admin

But when i am trying to manually insert product using same sku it is giving error as "SKU should be unique " this means that the products are already inserted in database

Products are not displaying in magento admin as well as on magento website


texts: Customer is not getting re-indexed and not upgrade via composer

texts:
Steps to reproduce
when I do reindex as below, I get the following error. Everything else works except customer is not getting re-indexed. So the in admin I cannot see any customers either although customers are there.

In addition , i cant upgrade Magento 2.1.2 to Magento 2.1.5

php -f bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
SELECT e., e.entity_id, TRIM(CONCAT_WS(' ', IF(e.prefix <> '', e.prefix, NULL), IF(e.firstname <> '', e.firstname, NULL), IF(e.middlename <> '', e.middlename, NULL), IF(e.lastname <> '', e.lastname, NULL), IF(e.suffix <> '', e.suffix, NULL))) AS name, e.email, e.group_id, e.created_at, e.website_id, e.confirmation, e.created_in, e.dob, e.gender, e.taxvat, e.lock_expires, TRIM(CONCAT_WS(' ', IF(shipping.street <> '', shipping.street, NULL), IF(shipping.city <> '', shipping.city, NULL), IF(shipping.region <> '', shipping.region, NULL), IF(shipping.postcode <> '', shipping.postcode, NULL))) AS shipping_full, TRIM(CONCAT_WS(' ', IF(billing.street <> '', billing.street, NULL), IF(billing.city <> '', billing.city, NULL), IF(billing.region <> '', billing.region, NULL), IF(billing.postcode <> '', billing.postcode, NULL))) AS billing_full, billing.firstname AS billing_firstname, billing.lastname AS billing_lastname, billing.telephone AS billing_telephone, billing.postcode AS billing_postcode, billing.country_id AS billing_country_id, billing.region AS billing_region, billing.street AS billing_street, billing.city AS billing_city, billing.fax AS billing_fax, billing.vat_id AS billing_vat_id, billing.company AS billing_company FROM customer_entity AS e
LEFT JOIN customer_address_entity AS shipping ON shipping.entity_id=e.default_shipping
LEFT JOIN customer_address_entity AS billing ON billing.entity_id=e.default_billingCustomer Grid indexer process unknown error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.lock_expires' in 'field list', query was: SELECT e., e.entity_id, TRIM(CONCAT_WS(' ', IF(e.prefix <> '', e.prefix, NULL), IF(e.firstname <> '', e.firstname, NULL), IF(e.middlename <> '', e.middlename, NULL), IF(e.lastname <> '', e.lastname, NULL), IF(e.suffix <> '', e.suffix, NULL))) AS name, e.email, e.group_id, e.created_at, e.website_id, e.confirmation, e.created_in, e.dob, e.gender, e.taxvat, e.lock_expires, TRIM(CONCAT_WS(' ', IF(shipping.street <> '', shipping.street, NULL), IF(shipping.city <> '', shipping.city, NULL), IF(shipping.region <> '', shipping.region, NULL), IF(shipping.postcode <> '', shipping.postcode, NULL))) AS shipping_full, TRIM(CONCAT_WS(' ', IF(billing.street <> '', billing.street, NULL), IF(billing.city <> '', billing.city, NULL), IF(billing.region <> '', billing.region, NULL), IF(billing.postcode <> '', billing.postcode, NULL))) AS billing_full, billing.firstname AS billing_firstname, billing.lastname AS billing_lastname, billing.telephone AS billing_telephone, billing.postcode AS billing_postcode, billing.country_id AS billing_country_id, billing.region AS billing_region, billing.street AS billing_street, billing.city AS billing_city, billing.fax AS billing_fax, billing.vat_id AS billing_vat_id, billing.company AS billing_company FROM customer_entity AS e


texts: catalog search not giving exact result magento 2.3.2

texts:
In magento 2.3.2 community edition, the catalog search not giving exact result. I have set Minimal Query Length =>2, I searched "wine cooler" but I getting result list karoo angel products. If I search same in this in admin panel it gives me exact result of wine glasses.
I have set proirity in store>attribute name to 1 and short description and description set no. still issue of result somehow chaged.

Please see this in attached image.


texts:
* @return Mage_Catalog_Model_Resource_Category_Flat
 */
protected function _loadNodes($parentNode = null, $recursionLevel = 0, $storeId = 0, $onlyActive = true){
    ....
    $nodes = array();
    return $nodes;

}

will this return an object or an array?


texts: Magento 2: add decimal number in the price

texts:
I am using magento 2.4 and have all the products prices in this format:

9.50 ,  67.00 , 50.99

How to add another decimal number to become:

9.500 ,  67.000 , 50.990


texts: Magento 2.3.1 after adding watermark product image disappears

texts: I am using Magento 2.3.1. After adding watermark product images disappears. How to solve? is this frame work bug?


texts: New Relic Magento\Csp\Model\CompositePolicyCollector::merge - Magento 2.4

texts:
In our New Relic we see the following component consuming 25% of the time of the catalog search page;
Magento\Csp\Model\CompositePolicyCollector::merge

What is casing this load? What section of Magento?
Error from CSP module:
The Content Security Policy 'font-src *.cloudflare.com *.fontawesome.com fonts.googleapis.com fonts.gstatic.com maxcdn.bootstrapcdn.com *.zopim.com *.zopim.io *.trengo.com *.pusher.com px.ads.linkedin.com wts.one data: 'self' 'unsafe-inline'; form-action secure.authorize.net test.authorize.net 'self' 'unsafe-inline'; frame-ancestors 'self' 'unsafe-inline'; frame-src www.paypal.com www.sandbox.paypal.com secure.authorize.net test.authorize.net www.google.com 'self' 'unsafe-inline'; img-src widgets.magentocommerce.com www.googleadservices.com www.google-analytics.com www.paypalobjects.com t.paypal.com *.vimeocdn.com www.paypal.com fpdbs.paypal.com fpdbs.sandbox.paypal.com s.ytimg.com data: *.cloudflare.com *.fontawesome.com fonts.googleapis.com fonts.gstatic.com www.gstatic.com www.google.com www.google.nl www.google.be *.doubleclick.net *.bing.com *.linkedin.com px.ads.linkedin.com *.zopim.com *.trengo.eu *.giphy.com *.amazonaws.com *.pusher.com *.zopim.io *.googletagmanager.com wts.one https://s.ytimg.com *.paypal.com 'self' 'unsafe-inline'; script-src assets.adobedtm.com www.googleadservices.com www.google-analytics.com www.paypalobjects.com js.braintreegateway.com www.paypal.com s.ytimg.com video.google.com vimeo.com www.vimeo.com www.sandbox.paypal.com t.paypal.com www.youtube.com secure.authorize.net test.authorize.net *.cloudflare.com *.cloudflareinsights.com *.fontawesome.com fonts.googleapis.com fonts.gstatic.com www.google.com www.gstatic.com www.googletagmanager.com *.doubleclick.net *.licdn.com *.linkedin.com px.ads.linkedin.com *.newrelic.com *.bing.com wts.one *.zdassets.com *.zopim.com *.zopim.io *.trengo.eu *.pusher.com *.paypal.com data: *.nr-data.net 'self' 'unsafe-inline' 'unsafe-eval'; style-src getfirebug.com *.cloudflare.com px.ads.linkedin.com *.fontawesome.com www.google.com www.gstatic.com fonts.googleapis.com fonts.gstatic.com maxcdn.bootstrapcdn.com *.trengo.com *.pusher.com wts.one *.paypal.com data: *.nr-data.net 'self' 'unsafe-inline'; object-src 'self' 'unsafe-inline'; media-src *.trengo.eu *.pusher.com 'self' 'unsafe-inline'; manifest-src 'self' 'unsafe-inline'; connect-src *.cloudflare.com data: *.nr-data.net *.fontawesome.com fonts.googleapis.com fonts.gstatic.com *.google.com www.google.nl www.gstatic.com www.google-analytics.com www.googletagmanager.com stats.g.doubleclick.net *.bing.com wts.one *.trengo.eu *.zdassets.com *.zopim.com *.zopim.io wss://widget-mediator.zopim.com px.ads.linkedin.com *.pusher.com *.paypal.com 'self' 'unsafe-inline'; child-src http: https: blob: 'self' 'unsafe-inline'; default-src 'self' 'unsafe-inline' 'unsafe-eval'; base-uri 'self' 'unsafe-inline';' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header.


texts: Need a combination of configurable and bundle product type

texts:
Hi I need to be able to configure a product like the below example but cannot do it with default Magento products.

Product with SKU 24KE
-With bundled products
-2 different color options (Black: 24KEB, White:24KEW)
When selecting a color option, the SKU must Change to 24KEB OR 24KEW.

Is there any extension or anyway I can do this?


texts: How to run --coverage-html unittest in magento 2 and where to see generated report report

texts:
When I run below command its run but where is report?

phpunit -c dev/tests/unit/phpunit.xml --coverage-html ./report vendor/magento/module-contact/Test/Unit

Where to see report in html format.


texts: Configurable product creates simple product as out of stock even if quantity given

texts:
I have created a configurable product. Then I edited the "Configurations", so I have created simple products associated with the item. I set the quantity and saved.

But the simple products are saved as out of stock.
Is this a bug? Any fixes?

Magento ver. 2.1.3.


texts:
{"message":"Please agree to all the terms and conditions before placing the order."}

I have tried everything but still, face issue. can anyone guide me?


texts:
What is the best way to create widget with a parameter with date picker?

The problem is that I did not find a good way to supply format value to Date element class.


texts: Add Custom Dropdown Attribute to Customer Gives Error

texts:
I have to add one drop-down field with two options. 1. Enable and 2. Disable. in the customer in admin side,

My code as following:

<?php

namespace Test\CustomerTax\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Config;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface {

    private $eavSetupFactory;

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

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
                \Magento\Customer\Model\Customer::ENTITY, 'customer_tax', [
            'type' => 'int',
            'label' => 'Apply Customer Tax',
            'input' => 'select',
            'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
            'required' => true,
            'default' => '0',
            'sort_order' => 100,
            'system' => false,
            'position' => 100
                ]
        );
        $sampleAttribute = $this->eavConfig->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'customer_tax');
        $sampleAttribute->setData(
                'used_in_forms', ['adminhtml_customer']
        );
        $sampleAttribute->save();
        }
    }

I am getting an error as follows:

  Missing required argument $options of
  Magento\Eav\Model\Entity\Attribute\Source\Config.

Please give me some solution.


texts: Magento 1 : Few product urls are getting 403 error

texts: Most of the product urls are working fine. But Few product urls are getting 403 error.


texts: _afterLoad() on models when loading collection

texts: I've defined some logic in the _afterLoad() for one of my models. When loading one model using Mage::getModel('foo/bar)->load(1) _afterLoad() is triggered and the extra data values are set. When loading a collection, though, _afterLoad is not triggered on every model. How can I make it work that a collection returns its models with _afterLoad() automatically executed?


texts: How to export/import configs in Magento?

texts:
We want switch to an integration system with our Magento installations. But I do not know how to export/import settings for deployment process.

I know in Drupal you use modules like Features and Strongarm, is there something similar in Magento?

Because we do not want change any settings in our live environment.

I found MageSetup, but I do not think that is exactly what I am looking for.

And I found this and this - can I address any config, that I can setup in admin panel, this way? Actually I do not want just override the config. I want safe it and when I go to admin panel, I want see there the new setting.

Is there such a feature in Magento 2?


texts:
I have completed my Magento application,then for testing purpose i have deploy the files in subfolder (http://domain.com/demo).

After tested the application i like to point exact domain(http://domain.com), so for that i deploy the file to live server and change the core_config table path also.

but after did all the work now the live server show the 404 issue,may i know what is the issue in that.and share your idea to resolve this problem.


texts:
Some days ago I read a new Magento bulletin:
https://community.magento.com/t5/Magento-DevBlog/3D-Secure-2-0-changes/ba-p/136460
about PSD2 requirements.

Our customer uses only PayPal Plus (not the regular PayPal). But we don't find any pieces of information about this combination. In Germany, it is essential to fulfilling the PSD2 requirements, but the PayPal documents are very vague about this point.

Can anybody share his thoughts about these topics?

Thanks, Mario


texts: Magento2 show a message in backend when shipping settings changing

texts:
I want to show a message in back-end when shipping settings getting changed.

For example, If i add Flat Rate -> Handling Fee more than 5 it should show a div just near like "Entered amount in higher".

Any help will be highly appreciated.


texts: How can i change order position of swatch in ascending Magento2

texts:
I want to change the sort order of size swatches.
I have already put it in sort order from admin but I could not see any result in the front side.
Actual Result

Expected Result

How can I sort it as per my expected result.


texts: "Group" is a required value when creating a new order from backend

texts:
After I upgraded to Magento 1.9.3.4 this error message appears when creating a new order with a new client:

"Group" is a required value.

I tried selecting a different group (default is General) but it's the same. It was working before the update.


texts:
I have just started playing around with Magento 2 pwa studio.

Now i need to add an image slider which I want to show in my pwa homepage.

How i can add slider on pwa venia homepage any suggestions ?


texts: MySQL database shrinks when uploaded to hosting server. Is there something wrong?

texts:
I'm moving my local installation of Magento to a dev location on my hosting server.  FTP is the easy part.
I created a new database on the hosting server, then connected via HeidiSQL.  I exported my database from my local to the hosting server with no problems that I could tell (no errors reported) but I noticed that when I compared the two databases in size, local is 102mb but hosted is 86mb.
I figured something went wrong, so I dropped all the tables in the hosted mysql to start over.
Second attempt was the same outcome, so I tried a different way.
I used the Magento backend to make a backup of the database.  Once I had the backup, I did the required modifications - removing the /*!40101 and */ at the beginning and end of the sql file, and uploaded it via PHPMyadmin.

Again, everything seemed to go off without a hitch, but when I accessed the database again via HeidiSQL, same problem, the database on the hosting server is smaller than local.

Am I missing something?  Will this new smaller database still work?


texts:
Vers. Magento 1.9.3.9

I need to override thi function from Mage_Core_Model_Store

public function roundPrice($price)
{
    return round($price, 2);
}

So I created e new module:

app/etc/modules/MyCompany.xml

<config>
     <modules>
        <MyCompany_RoundPrice>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                 <Mage_Core />
            </depends>
       </MyCompany_RoundPrice>
    </modules>
</config>

app/code/local/MyCompany/RoundPrice/etc/config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
  <modules>
    <MyCompany_RoundPrice>
      <version>0.1.0</version>
    </MyCompany_RoundPrice>
  </modules>
  <global>
    <models>
      <roundprice>
        <class>MyCompany_RoundPrice_Model</class>
      </roundprice>
      <core>
        <rewrite>
          <store>MyCompany_RoundPrice_Model_Store</store>
        </rewrite>
      </core>
    </models>
  </global>
</config>

app/code/local/MyCompany/RoundPrice/Model/Store.php

<?php

class MyCompany_RoundPrice_Model_Store extends Mage_Core_Model_Store
{
    public function roundPrice($price)
    {
        return round($price, 4);
    }
}

It should work but it doesn't.

What is wrong???

EDIT

Some tests:

echo Mage::helper('core')->isModuleEnabled('MyCompany_RoundPrice').'
'; //output 1
echo Mage::helper('core')->isModuleOutputEnabled('MyCompany_RoundPrice').'
'; //output 1
echo Mage::getModel('roundprice/store')->roundPrice(1.23456789); //output 1.2347
echo Mage::getModel('core/store')->roundPrice(1.23456789); //output 1.23

The module is active and reachable, but doesn't override the core file.


texts: Head miscellaneous script is not being added

texts:
I'm adding a tracking script to "Miscellaneous Scripts" at Design->HTML Head section but it is not working. If a search for the script added in my shop html source code it does not appear.

Please find the next screenshot:
https://cdnweb5.vikinguard.com/wp-content/uploads/2015/12/3.png

Adding the script to "Miscellaneous HTML" at Footer section works properly. Any idea of why it works from footer and does not work from head?


texts: Magento 2: Apply visibility and status filters on product collection

texts:
I want to apply visibility and status filter on product collection. Like in Magento 1 we do:

Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);

Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);

I get the product collection in Magento 2 but not find function to apply above filters.