texts: addtocart pixel after add to cart event happened

texts:
I am trying to inject a pixel to the webpage when addtocart event happens, however I am not sure how to do it. there are different ways which came to my mind:

1-make an observer and add a handle to the layout and the handle has a phtml file which has the pixel inside it:
I tried this solution but I get an error when I try

Class Scosche_Facebook_Model_Observer {

    public function appendAddToCartPixel(Varien_Event_Observer $observer){
       $layout = $observer->getEvent()->getLayout();
          $layout->getUpdate()->addHandle("handlename");
    }
}

the layout for some reason is null and I am not sure why I cannot get the layout.

I know that I should listen to

  controller_action_layout_generate_blocks_after

so that I can get the layout but I also should listen to checkout_cart_product_add_after so I am a bit confused.

2- make an observer and just put the pixel right over there:

Class Scosche_Facebook_Model_Observer {
    public function appendAddToCartPixel(Varien_Event_Observer $observer){
        $html = <<<HTML
    <!-- Begin Facebook AddToCart Pixel -->
    <script type="text/javascript">
        fbq('track', 'AddToCart');
    </script>
    <!-- End Facebook AddToCart Pixel -->
HTML;
        return $html;
    }
}

This does not do anything either, Although I am sure the function runs. I also used a simple echo but when I checked page source view it was not there, here is config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Scosche_Facebook>
            <version>1.0.0</version>
        </Scosche_Facebook>
    </modules>
    <global>
        <models>
            <scosche_facebook>Scosche_Facebook_Model</scosche_facebook>
        </models>
    </global>
        <frontend>
        <events>
            <checkout_cart_product_add_after>
                <observers>
                    <scosche_facebook>
                        <class>Scosche_Facebook_Model_Observer</class>
                        <method>appendAddToCartPixel</method>
                    </scosche_facebook>
                </observers>
            </checkout_cart_product_add_after>
        </events>
            <layout>
                <updates>
                    <facebook>
                        <file>facebook.xml</file>
                    </facebook>
                </updates>
            </layout>
        </frontend>
</config>

and here is the Observer:

Class Scosche_Facebook_Model_Observer {

    public function appendAddToCartPixel(Varien_Event_Observer $observer){
???????
    }
}

I am not sure how to do this. I tried steven answer on this link:
Adding New Facebook pixel to <head>


texts:
I have a big problem with one magento installation.
It is a Magento Version 1.8.0.0 running on apache with php5-fpm, a Varnish cache in front and nginx as ssl reverse proxy.

If I open any URL using https, magento redirects to http://shopurl/index.php/
This then redirects to Location:/
I switched Web server rewrites and rediect to startpage off in the settings, no change.
I created a dbg.php

<?php
var_dump($_SERVER);
echo "\n\n\ngetenv('HTTPS'): ";
print_r(getenv('HTTPS'));

The result is: this

You can see, that $_SERVER['HTTPS'] is set.

I don't know where else I can look to find the problem.
For now, I changed the secure url to http://, because users where not able to login or purchase.
But this can't be permanent.

Any Ideas how I can find out what is wrong?

If I activate proxy_redirect http:// $scheme://; in nginx, so it changes redirects to http:// to https://, a redirection loop endlessly redirecting to https://domain/index.php/ is the result.

The apache rewrite log for https://domain/test shows:

127.0.0.1 - - [06/Feb/2014:12:20:14 +0000] [domain/sid#7f6236faac58][rid#7f61439ff0a0/initial] (2) [perdir /var/www/magento/] rewrite 'test' -> 'index.php'

So it seems that the redirect happens inside the magento PHP code...


texts: Need to configure more than three redis server for session Magento2

texts:
I have three radis server with load balancing. the radis session is shared by global for all instance. i configure the radis cache for magento2 EE session in env.php for single radis url. I need to configure the three radis URL in env.php. because if any one radis server down it need to switch to other server.

How i can configure the multiple radis session in single website.


texts:
Back in M1 you could log the slow queries by modifying the following variables in lib/Varien/Db/Adapter/Pdo/Mysql.php :

/**
  * Write SQL debug data to file
  *
  * @var bool
  */
 protected $_debug               = false;
 /**
  * Minimum query duration time to be logged
  *
  * @var unknown_type
  */
 protected $_logQueryTime        = 0.05;
 /**
  * Log all queries (ignored minimum query duration time)
  *
  * @var bool
  */
 protected $_logAllQueries       = false;
 /**
  * Add to log call stack data (backtrace)
  *
  * @var bool
  */
 protected $_logCallStack        = false;
 /**
  * Path to SQL debug data log
  *
  * @var string
  */
 protected $_debugFile           = 'var/debug/sql.txt';

So I'm wondering how can I do that in M2? I've found some interesting stuff in lib/internal/Magento/Framework/DB/Logger/LoggerAbstract as well as lib/internal/Magento/Framework/DB/Logger/File but I ain't 100% sure how to tackle this.


texts: Magento 2 : How quickly can you install with composer a Magento2 last version without sample data


texts: Function in not defined in custom jquery when using href=javascript

texts:
I am trying to setup slider. When i connect jquery library just as  and connect slider code just as  with no  require([ 'jquery', 'jquery/ui'], all works fine.

But when i try to connect script through magento jquery and delete link to jquery library, script won't work and shows error Uncaught ReferenceError: slide is not defined

Also when I am trying to connect custom jquery code via requirejs-config.js i got the same error.

So how make it works through right way (with no external jquery library)?

Here is part of HTML code:

LEFT

Jquery code:

      require([ 'jquery', 'jquery/ui'], function ($){

            function slide(direction) {
                    var slider_full_width = $('.slides_box li').outerWidth() + 28;

                    if (direction == 'left') {
                        var left_sliding = parseInt($('.slides_box').css('left')) + slider_full_width;
                    } else {
                        var left_sliding = parseInt($('.slides_box').css('left')) - slider_full_width;

                    }

                    $('.slides_box:not(:animated)').animate({'left': left_sliding}, 350, function () {
                        if (direction == 'left') {
                            $('.slides_box li:first').before($('.slides_box li:last'));
                        }
                        else {
                            $('.slides_box li:last').after($('.slides_box li:first'));
                        }
                        $('.slides_box').css({'left': '0'});
                    });
                }
          });

EDIT: I have an idea why it don't work. Because after adding requirement of magento jquery it render my custom code inside $(document).ready(function() {, but javascript href works only outside of ready function. Anyway i don't know how to fix this.


texts: call a single page from two different link in magento

texts:
I added two link on index page.Both are redirecting to same registration page.

I want,when someone click on "SELLER" then
"Do You Want To Become Seller / Vendor?" this should not display.

How can i get where user click on "signup" or "seller".?
and in which file we have to change ?


texts: Create custom product image editing options

texts: I have a requirement to build a magento site with customize option for products as given in http://fineartamerica.com/products/mona-lisa-leonardo-da-vinci-framed-print.html . How can I achieve this. Searched many in net but couldn't find the one.


texts: Magento 2 - Is there a way to have Magento refresh the quote data in checkout on the frontend?

texts:
Background

I am working on a module that replaces the shipping address, shipping method, and payment steps during checkout with an external iframe solution. This is basically a replacement for checkout, however I am trying to do it in a way that is minimalistic in what I rewrite (why re-invent the wheel for things I don't really need to re-invent?) When address information is updated in the iframe, a call-back POST hits a custom controller where I update the address and shipping method on the quote.

Question

Is there a way I can tell the frontend that it needs to refresh its copy of the data with what is actually in the database?

Things I've tried already

I have tried firing off the appropriate JS functions to set the billing/shipping address and shipping method on the quote.  In fact, I am doing this now as it seemed to be the only way to get the shipping subtotal to populate. However, this has problems of its own:

Since I don't know the correct region_id, I either have to do custom AJAX calls to look it up or load some massive JS object to iterate over looking for the appropriate ID (I'm currently doing the AJAX thing as it seemed less intesive on the browser)
There are race conditions that occur that cause address changes to get overwritten by the previous address (not to mention all the extra DB traffic that is happening because of this)
Even though sales tax has been calculated correctly in the database, it is still not showing in the subtotals or grand total on the frontend (this is actually the real problem I am trying to solve here, however I feel the current setup I have is overly complicated and would be cleaner if Magento would just refresh its data from the database)

I have tried loadSection calls.  But those seem to only update the mini-cart or the sidebar totals

Things I cannot change

I cannot change the callback POSTs (that is, I can't stop them from happening).  They must occur in order for the iframe to get updated information from Magento (eg, sales tax, shipping rates, etc..)
For reasons I won't go into here, I need to reuse as much of the existing checkout as possible (see background section where I mentioned trying to be as minimalistic as possible)
I cannot change anything on the form inside the iframe (eg, I can't pass it region ids to include in the region/state dropdown).  It is intentionally generic as it is used with other ecommerce platforms.


texts: How can I get the customer increment ID in an observer in Magento2 if using the human friendly ID

texts:
I am trying to get a magento customer increment ID. I'm thinking I have to use the resource-model class just not sure what the best way to access it is or how to get it.

public function __construct(
    \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface,
    \Magento\Customer\Model\ResourceModel\Customer $resourceModel,
){
    parent::__construct();
    $this->customerRepo = $customerRepositoryInterface;
    $this->customerResource = $resourceModel;
}

protected function execute(
    InputInterface $input,
    OutputInterface $output
)
{
    $email = 'email@email.com'
    $data =  $this->customerRepo->get($email);
    $cid =  $data->getId(); //checking exists
    $rsrd= $this->customerResource->loadByEmail($data,  $email);
    $incrementid =  $data->getAttribute('increment_id');
    $output->writeln( 'email: ' . $email . ' customer id: ' . $incrementid );
}


texts: Can I close the browser while Magento is reindexing?

texts: While Magento is reindexing data, can I close the browser? Or does the browser still need to be open?


texts:
I copied my website from localhost to server. For the first 3 days shop worked properly, but now there is an error.

http://demo2.ninethemes.net/fastor/magento2/

Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.

I did it and still, I am getting this error. On localhost, shop works properly. I don't know how to fix it.


texts: Add Transactional Email Template page does not load properly

texts:
I am just about to finish my first project with Magento and as always I have crashed something right before the finish line:
I'm using Magento 1.9.0.1 (Community Edition).
When I go to Transactional Emails and press the "Add new template" button (I'm sorry for wrong translations, I'm using the German backend (which is quite a mess)) I do not get to the Add template page although it worked yesterday. What I see now is this:

I am not too experienced with PHP, but my guess is that there might be php Tags missing or a file needed for only this page is missing. I have of course tried googling for the solution but no results.


texts: I want to send different email with different manage to Customer and Admin as per payment method. [ Magento 1.9 ]

texts:
How can I send different sales emails in Magento 1.9?

for example:

Payment method:
1. PayU
2. EFT

Case 1:
 - Customer place order and paid with PayU. Customer will receive EMAIL TEMPLATE A ( Customer copy ) and Admin will receive EMAIL TEMPLATE B ( as an acknowledgement ).

Case 2:
 - Customer place order and paid with EFT. Customer will receive EMAIL TEMPLATE C ( Customer copy ) and Admin will receive EMAIL TEMPLATE D ( as an acknowledgement ).

Thank you.


texts: How to Implement Real Time Notifications in Magento

texts:
I don't know is it possible or not.

Would like to display real time notifications to Customer Profile.

I've custom functionality in M2 store where user can like products so if he likes certain products than seller of that product receive this notification.

You can keep FB in Mind.

How to achieve this ? any guide OR Any references ?


texts: Problemas con Variables de Sesión - MAGENTO 1.9.2

texts:
Tengo el siguiente problema.

Normalmente al crear una cuenta para un dominio en CPANEL, el caché de la plataforma queda se guarda en /home/nombre_de_cuenta/public_html/var/session, sin embargo me está ocurriendo que por algún motivo los archivos temporales de la plataforma se están creando en un directorio llamado MAGENTO ubicado en la raiz del server, específicamente en /tmp/magento/var/session.

De verdad no se que pasa, al revisar en /home/nombre_de_cuenta/public_html/var/session noto que no se genera ningún archivos de sesión.

Que puede estar pasando?

Gracias.


texts:
I have added one field i.e. checksum alongwith coupon code on payment page. Now I want to get and set checksum field.

I tried,

etc/extension_attributes.xml

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

Test\GiftCard\Api\Data\GiftCardInterface

<?php

namespace Test\GiftCard\Api\Data;

interface GiftCardInterface
{
     public function getChecksum();
     public function setChecksum($checksum);
}

But I am getting error -

      Property \"Checksum\" does not have accessor method \"getChecksum\" in class \"Magento\\GiftCardAccount\\Api\\Data\\GiftCardAccountInterface\".


texts:
Display Sale icon on special price products in magento. Only at homepage it is showing not in all pages.
Code I have edited in
app/design/frontend/default/template/catalog/product/list.html
from the line number: 95

    <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
    <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
<?php
    // Get the Special Price
    $specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice();
    // Get the Special Price FROM date
    $specialPriceFromDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialFromDate();
    // Get the Special Price TO date
    $specialPriceToDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialToDate();
    // Get Current date
    $today =  time();

    if ($specialprice):
        if($today >= strtotime( $specialPriceFromDate) && $today <= strtotime($specialPriceToDate) || $today >= strtotime( $specialPriceFromDate) && is_null($specialPriceToDate)):
 ?>

<?php
        endif;
    endif;
?>

This icon is displaying in homepage only not in All product list of pages. How do i display in all pages?


texts: Want to add custom js to the customer order view page

texts: Hi I want to add the custom js to customer order view page(https://goodwayorganic.com/new/sales/order/view/order_id/75/)


texts:
Suppose I have a Magento page www.ce.li/apparel.html and my site has an alias name, say abc.ce.li. When I access abc.ce.li/apparel.html (using alias abc instead of www) Magento redirects me to it's home page, www.ce.li. How can I change such behavior? I want to get to www.ce.li/apparel.html, not to homepage.

Thanks!


texts:
I just found this on another question but I'm unable to comment because of my reputation.

$incrementId = '1000001'; //replace this with the increment id of your actual order
$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);

if ($order) {
    $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);
    $order->setStatus('pending');

    $order->setBaseDiscountCanceled(0);
    $order->setBaseShippingCanceled(0);
    $order->setBaseSubtotalCanceled(0);
    $order->setBaseTaxCanceled(0);
    $order->setBaseTotalCanceled(0);
    $order->setDiscountCanceled(0);
    $order->setShippingCanceled(0);
    $order->setSubtotalCanceled(0);
    $order->setTaxCanceled(0);
    $order->setTotalCanceled(0);

    foreach($order->getAllItems() as $item){
        $item->setQtyCanceled(0);
        $item->setTaxCanceled(0);
        $item->setHiddenTaxCanceled(0);
        $item->save();
    }
    $order->save();
}

Is there any way to get back the cancelled order?

Do I put this code into a php file, upload it via ftp then run it?

We are using Magento ver. 1.8.1.0

Thanks,
Callam


texts:
I created a template (phtml) and placed it into my theme folder. I then went to a cms block and placed this

{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::footer-social.phtml"}}

Nothing renders. I've read other posts in regard to this and they all seem to be similar.


texts: Getting shipping costs in cart without address?

texts:
If the user puts an item to the cart, Magento shows no shipping costs, because it doesnt know the shipping address yet. I searched the code, where it tries to find the address, but could not find it. I want to set a shipping address in Germany if there is no address specified yet. Any idea in what part of the code I have to do that?

Thanks!


texts: magento 1 observer for special price end date

texts:
Is any observer fire after special price date is ended ? Or did you have any idea for check when special is ended ? or maybe should i change this code function

    public static function calculateSpecialPrice($finalPrice, $specialPrice, $specialPriceFrom, $specialPriceTo,
        $store = null)
{
    if (!is_null($specialPrice) && $specialPrice != false) {
        if (Mage::app()->getLocale()->isStoreDateInInterval($store, $specialPriceFrom, $specialPriceTo)) {
            $finalPrice     = min($finalPrice, $specialPrice);
        }
    }
    return $finalPrice;
}


texts: How can i get user list of all the orders place in Magento2 using rest api

texts: In Magento2 How can i get the list of orders placed by specific user using REST API ?


texts: what is Integration module purpose in magento2?

texts:
I want to know Module_Integration purpose in Magento2.

And how it related with Module_Authorization in Magento2


texts:
have issue on product detail page clicking any product it redirect to product detail page.
but show only image with mouse over zoom effect and left side bar and footer missing.


texts: Observer - Stop controller action after review_save_after

texts:
I am using Magento 1.7.0.2. I need to prevent ratings in the frontend from saving after the reviews has been saved. So I have used the <reveiw_save_after> event in order to achieve it. But I am unable to stop the controller action from happening after the save event. Here is my code:

etc\config.xml

    <events>
        <review_save_after>
            <observers>
                <rating_prevent_observer>
                    <type>singleton</type>
                    <class>MyModule_Rating_Model_Observer</class>
                    <method>preventAddRatings</method>
                </rating_prevent_observer>
            </observers>
        </review_save_after>
    </events>

Rating\Model\Observer.php

     class MyModule_Rating_Model_Observer
     {
        function preventAddRatings(Varien_Event_Observer $observer)
        {
            $app = Mage::app();
            $request = $app->getRequest();

$app->getFrontController()->getResponse()->setRedirect($request->getBaseUrl() . $request->getPathInfo());
        }
    }

The observer is calling but the controller action is still executing. Is this the correct way to prevent the controller action?.

Thanks.

Update:

I tried using the below code but I am unable to get the controller action from the observer object.

$controller = $observer->getControllerAction();
$controller->getRequest()->setDispatched(true);
$controller->setFlag(
    '',
    Mage_Core_Controller_Front_Action::FLAG_NO_DISPATCH,
    true
);


texts:
I am really really new to Magento 2 so forgive my lack of knowledge.

I am reading the Magento documentation and I keep seeing Magento file system owner.

E.g. sudo -u Magento_file_system_owner  command

Problem is, I don't really understand what this user is or how to create it. I've tried to research online, but couldn't really find a clear explanation on how to create a Magento file system owner.

Any help/guidance is very much appreciated!


texts: Translation doesn't work on breadcrumbs added by xml in Magento 2

texts:
I am trying like below to put Breadcrumb and translation in Contact page of Magento 2. But can't translate. I put translation file under /vendor/magento/module-contact/i18n/zh_Hant_TW.csv Is it not correct?

    <referenceBlock name="breadcrumbs">
                 <action method="addCrumb" translate="crumbInfo.title crumbInfo.label">
                     <argument name="crumbName" xsi:type="string">home</argument>
                     <argument name="crumbInfo" xsi:type="array">
                         <item name="title" xsi:type="string">Home</item>
                         <item name="label" xsi:type="string">Home</item>
                         <item name="link" xsi:type="string">/</item>
                     </argument>
                 </action>
                 <action method="addCrumb" translate="crumbInfo.title crumbInfo.label">
                     <argument name="crumbName" xsi:type="string">Contact Us</argument>
                     <argument name="crumbInfo" xsi:type="array">
                         <item name="title" xsi:type="string">Contact Us</item>
                         <item name="label" xsi:type="string">Contact Us</item>
                     </argument>
                 </action>

    </referenceBlock>


texts:
I want to have all my customers to register before they can see the prices and from the registration form they will have option to pick register as retail or wholesale customer. If they register as wholesale, they will have to wait on approval to grant access. If they register as retail they will be granted access to see retail price and check out.
On approval for login as wholesaler they will be able to see the wholesale prices and use different shipping and payment method. Can someone please how do I accomplish this goal?


texts: Get Transaction Additional Info in magento refund

texts:
I am making a custom payment gateway and I have it in the capture payment in Magento when a payment has been through:

$payment->setTransactionAdditionalInfo
           (Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,array
('TransactionGUId'=>$result['transaction_guid'], 'TransactionId'=>$result
['transaction_id'],'Messages'=>$result['messages']));

Which writes the payment transaction additional information.
I need to get in the refund these additional informations to send them to the payment Gateway.
I tried:

 $collection = Mage::getModel('sales/order_payment_transaction')->getCollection()
 ->addAttributeToFilter('order_id', array('eq' => $payment->getOrder()->getEntityId()))
 ->addAttributeToFilter('txn_type', array('eq' => 'capture'))
        ->addPaymentIdFilter($payment->getId());

       $transaction = $collection->getAdditionalInformation('transactionId');
        $transactionGUId = $collection->getAdditionalInformation('transactionGUId');

but it returns an error.


texts: Magento2 : How To Solve Controller 404 Not Found Error On Live Server

texts:
I have create one controller and it is working fine in local environment
but when i upload that files to live server is shows 404 not found error,

These are my code, please let me know if anyone have idea about this issue.

controller URL: http://127.0.0.1/test/product/index

  app/code/Vendor/Test/etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
  <router id="standard">
    <route id="test" frontName="test">
      <module name="Vendor_Test"/>
    </route>
  </router>
</config>

  app/code/Vendor/Test/Controller/Product/Index.php

<?php

namespace Vendor\Test\Controller\Product;

use Magento\Framework\App\Action\Action;

class Index extends Action
{

    public function execute()
    {
        echo "hello1";
        die();
    }
}


texts: Replace class from core in my module without rewrite (preferences)

texts:
In the magento 1 I can move a class from /core to /local. Then used the file from /local.

How to make this in Magento 2?


texts: Magento bundle items tab in admin showing suddenly a blank page without options

texts:
I've created more than 200 bundled products and it worked always as expected. But suddenly, the bundle items tab to add the bundle options is showing a blank page. I have absolutely no idea why this happened. I cleared cache but without results. When opening an existing bundle product, it shows the bundle options. Creating a new one doesn't.

The ajax content that is loading when clicking "Bundle items" is referring to https://www.mywebsite.com/index.php/admin/admin/bundle_product_edit/form/id/15064/ and I get a ERR_EMPTY_RESPONSE. Existing bundle products have the same url, other ID and getting response. I copied the website local and there this is working. So something with folder permissions, server setup, routing?

Any ideas?


texts: Moving URLs and files on the server: Do I need to change something in the database before the move?

texts:
I have purchased some disk space and two domains from my hosting
provider. I am currently not using a dedicated IP + SSL certificate
because I am just testing. In fact both of the following two sites
are used for testing, but I need to move my Magento site from
SITE1 to SITE2:

SITE1
Domain: world.com
WebSite Root Directory (where magento is installed): ~/public_html

SITE2
Domain: hello.com (alternatively I could also configure SITE2 to be
  served from hello.world.com or world.com/hello via cPanel, and save
  world.com for some other site)
WebSite Root Directory (where magento needs to be moved to): ~/public_html/hello

Will I run into any trouble if I carry out the above operation?
I am particularly concerned with having to change URLs in the Magento database
(namely any references to world.com to hello.com).


texts:
I am trying to upgrade magento version from 2.1.9 to 2.1.10

I got following error.

  Module 'Magento_Ui' from '/home/zitomer/upgrade.zitomer.com/app/code/Magento/Ui' has been
  already defined in
  '/home/zitomer/upgrade.zitomer.com/vendor/magento/module-ui

How to resolve this error as I am not able to upgrade on 2.1.10


texts: Magento2 : Getting Error when enabled Flat catalog Category and Product

texts:
I am using magento 2.3.2. My site takes too much to load.
I enabled flat catalog category and Flat catalog product. See https://prnt.sc/pgr3xu.
But on site when i click on any product it gives me error "Invalid argument supplied for foreach() in /var/www/html/ihouzit/app/code/Mageplaza/Search/Helper/Data.php on line 345" See https://prnt.sc/pgr3zx
What can be the issue.

Getting error from this function

protected function getCategoryOptions($category, &$options, $level, $htmlPrefix = '')
{
    if ($level <= 0) {
        return $this;
    }
    $level--;

    $options[$category->getId()] = $htmlPrefix . $category->getName();

    $htmlPrefix .= '- ';
    foreach ($this->getChildCategories($category) as $childCategory) {
        $this->getCategoryOptions($childCategory, $options, $level, $htmlPrefix);
    }

    return $this;
}


texts:
After some days off miserable testing and trying to figure out what I'm doing wrong I decided to ask it here.

I'm trying to write a custom validation rule that validates the combination of 2 fields (first & last name). The rule itself is very straight forward, it's a max-length.

I've created this rule and added it to the form field, now I'm unable to get it working. There is just no response, no error messages to be found (no in console or the logs).
I started out with a separate js file for the custom rules/ custom js and added it to the page.xml. Meanwhile I've tried adding it to the validation.js to be sure the rule get's loaded, same result.

I have the following questions:

If validating 2 fields, does the rule needs to be set on both (the css-class)
How would I debug validation rules

This is what I've tried:

Validation.addAllThese([
    ['validate-name-length', 'The combination of first & last name cannot exceed 30 characters.<br/>Use initials if needed', function(v) {

        var length_firstname = $('billing[firstname]').value.length;
        var length_lastname = $('billing[lastname]').value.length;
        var result = true;

    if ((length_firstname + length_lastname) > 30) {
             result = false;
        } else {
             result = true;
        }
        return result;
    }]
}];

I've tried to work with the passed field in the validation but then you have difficulties getting the other field's value.

I have a strong feeling I made some stupid mistake and I'm looking over it. I get confused really quick with the Prototype/JQuery use in Magento. Any help would be appreciated.


texts: Getting product object inside defaultinvoice.php file for getting custom attribute values

texts:
I will tell what i have done till now.

I have made a custom module to override the

  Magento\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice

file and its working fine.

I am able to get sku, name, price in the invoice pdf in any location. Now i am trying to get the product object inside it to get custom attribute values.

Most of the tutorials i found is advised to use objectmanager that i am not interested in looking into. Rather i need to include those via factory or repository.

my question is how we can get product object inside model file(for example defaultinvoice.php file).

Please advise.


texts: Call cms block in store language in Magento2

texts:
In Magento2, I have CMS a page on which I want to upload the customer registration form. I have inserted this code for it:

{{block class="Magento\Customer\Block\Form\Register" template="Magento_Customer::form/register_default_fr.phtml"}}

The website is in two different languages. Yet the block loads in the default language (English) on both store views.

Could anyone tell how to load the registration form in the corresponding store view languages?

Thanks a lot!


texts: search the text which is present in database or in template files

texts:
I want to change text in site.

when i tried template path hints, it did't worked for me.

the text is present in list view page, i tried in list .phtml, no luck.

i searched in static blocks and cms pages, still no luck

is there any way we can search the text which is present in database.

if you visit here & search for "folks" you can  find text in italics, i want to chnage that text to normal font using phtml code.


texts:
I have one store (base) and I need to create another root category to test a new strucutre out so my plan was to create a new Root Category and then tell magmi to import into that... No such luck.

I've created a new root category called Testing.

Here is a sample of the Data.

sku,categories
12345, [Testing]/Level1;;[Testing]/Level1/Level2;;[Testing]/Level1/Level2/Level3

Every time I try and import this, I get this error:

On the fly category creator/importer v0.2.5 - Cannot find site root with names : Testing,Testing,Testing

Can anyone help me out with this one?


texts: Magento 2: Subscribe to changes on company in checkout

texts:
I need to somehow subscribe on changes in the company field in the checkout. But i'm not sure how. I think i can somehow add it to shipping.js in the magento_checkout module but not sure how. Anyone can point me in the right direction?

Full functionality i'm trying to create is that i want to display/hide a payment method if company is filled. I tried this is php (Magento 2: Hide payment method if company name field got a value) but a payment provider crashed after disabling a payment method so i think JS is the way to go but i'm a bit lost.

Thanks in advance.


texts: How to fetch post method xml data in Magento2 controller

texts:
We have to implement the punchout concept in magento2.

There is a 3rd party system they will send data using the cXML format to Magento 2 endpoint. We need to fetch that data in the Magento2 & need to process & need to return the data in the form of cXML format.

For this, we have implemented the vie/api/punchout controller concept instead of REST APIs.  which is working when we use the PUT method but it is not working for the POST method.

Note: It should be work for the POST method.
When we use POST method our controller is not triggering can anyone help me on this issue.

https://drive.google.com/file/d/1b_aQdjNuamo1VLsLzts0nAsuPGUFjl2H/view

https://codeshare.io/alW8lB
sample cXML format: https://codeshare.io/2W91Nd

I have followed the below approaches in the controller but those are working for the PUT method,
 not for the POST method as per the client request, it should work for the POST method.

  $postData = $this->getRequest()->getContent();
   $opts = array('http' =>

    array(
        'method'  => 'POST'
        )
        );
    $context  = stream_context_create($opts);

    $x=file_get_contents("php://input", false, $context);>
    echo $x;

    $rawData = file_get_contents("php://input");
 echo $rawData;

Steps to verify:

  Create on the custom controller in your custom module ex: vie/api/punchout
  Open postman app
  Keep sample XML data in the postman app at body and type is XML format which I have mentioned above.
  Try to fetch the data using the POST method in the controller


texts: Signature invalid while hitting magento 1.9 rest API

texts:
I am facing signature error while hitting api

{"messages":{"error":[{"code":401,"message":"oauth_problem=signature_invalid"}]}}


texts: Magento 2 Error During Update Module Via Composer

texts:
magento/product-community-edition is locked to version 2.4.1 and an update of this package was not requested.
- magento/product-community-edition 2.4.1 requires magento/module-configurable-product 100.4.1 -> found magento/module-configurable-product[100.4.1] but it conflicts with another require.

Please help me about this


texts: Get the meta description and page title of any page

texts:
How can I get the meta description and page title of any page in Magento (product page, category page, CMS page and any other page).  This is for Magento 1.9.

I have tried something along the lines of:

if( Mage::registry('current_product') ){  // product page
    $product = Mage::registry('current_product');
    $title = $product->getMetaTitle();
    $descr = $product->getDescription();
}elseif( Mage::registry('current_category') ){  // category page
    $category = Mage::registry('current_category');
    $title = $category->getTitle();
    $descr = $category->getDescription();
}else{  // CMS / any other page
    $title = $this->getTitle();
    $descr = $this->getDescription();
}

But this isnt working in every case. Can anyone help?


texts: How to remove save and reset button from edit form?

texts:
In custom module I have one grid. in that grid i don't want to edit data from admin panel. I want to just view of that data so i want to remove save button and reset button.

In Edit.php

public function __construct()
{
    parent::__construct();
    $this->_objectId = "example_id";
    $this->_blockGroup = "example";
    $this->_controller = "adminhtml_example";
    // $this->_updateButton("save", "label", Mage::helper("example")->__("Save Tutor"));
    $this->_updateButton("delete", "label", Mage::helper("example")->__("Delete Tutor"));

    /**
    $this->_addButton("saveandcontinue", array(
        "label"     => Mage::helper("example")->__("Save And Continue Edit"),
        "onclick"   => "saveAndContinueEdit()",
        "class"     => "save",
    ), -100);

    $this->_formScripts[] = "
        function saveAndContinueEdit() {
            editForm.submit($('edit_form').action+'back/edit/');
        }
    ";
    */
}

I m comment code of save button and saveAndContinueEdit button but save button is display.

I know another way to admin can't save data using disable set as true in all addfield but i want to remove add button and reset button if possible and i want to remove this button using custom module.


texts: Magento 2.0 - How to add jquery on click to a button or link a JS file in System.xml

texts: I need a button in my custom system.xml to do Ajax call.  How can this be achieved? or how can I link a JS file into my system.xml?


texts: Not getting Order Confirmation Emails but I get the "Welcome, Allysin!" Email after registering while placing an order

texts:
Magento 1.9.3.7 out of the box
Porto theme

I did a new Magento install. I put the Porto theme in, added categories and products and put in all the relevant info.

Now, when placing a test order - I never receive the Order Confirmation Email (I tried with 2 different Email addresses and checked the Spam folders).

What's interesting is - when going through and placing an order, I register for an account and then get the Welcome Email titled: Welcome, Allysin! with the message that looks like this:

Welcome to MYSITE.

To log in when visiting our site just click Login or My Account at the top of every page, and then enter your email address and password.
Use the following values when prompted to log in:
Email: myEMAILaddress
Password: myPASSWORD
When you log in to your account, you will be able to do the following:
Proceed through checkout faster when making a purchase
Check the status of orders
View past orders
Make changes to your account information
Change your password
Store alternative addresses (for shipping to multiple family members and friends!)
If you have any questions, please feel free to contact us at support@example.com .

Thank you, MYSITE!

Why would I not receive the Order Confirmation Emails if I get these Welcome Emails?


texts:
I am looking for entire example/sample code for adding the first item to your magento cart via php programatically.  This code should create the ENTIRE SHOPPING CART and send the user to the checkout page.    I am not looking to create a complete order already paid.  I am looking to create a complete CART that will allow the user to finish checkout. Why is this so complicated? My current code will only allow checkout if the first item was added from normal website (cart not empty).  My module allows user to add a custom product, which could obviously be added before the user has items in the cart.

here is my module:

http://jaycon.sceneserver.com/index.php/quickrfq/index/?service=PCB%20Production

and here is the source code that should use the existing quote, or create a new one:

// do the new addtocart action
$quote = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();

if(!empty($quote)){
    $session = Mage::getSingleton('customer/session');
    // Get cart instance
    $cart = Mage::getSingleton('checkout/cart');
    $cart->init();

    $productInstance = Mage::getModel('catalog/product')->load($productId);

    $request = new Varien_Object();
    $request->setData($param);
    $cart->addProduct($productInstance, $param);
    $session->setCartWasUpdated(true);
    $cart->save();

    // get cartItems and store last item ID
    $cartItems = Mage::getModel("checkout/cart")->getItems();
    foreach($cartItems as $item) {
        $cart_ids[] = $item->getId();
    }
    $cart_id = end($cart_ids);
    Mage::getSingleton('core/session')->setPCBCartId($cart_id);

}
else { // need to run the full code to create a quote

    // Get customer session
    $session = Mage::getSingleton('customer/session');

    $customer_id = Mage::getSingleton('customer/session')->getId();
    $store_id = Mage::app()->getStore()->getId();
    $customerObj = Mage::getModel('customer/customer')->load($customer_id);
    $quoteObj = Mage::getModel('sales/quote')->assignCustomer($customerObj);
    $storeObj = $quoteObj->getStore()->load($store_id);
    $quoteObj->setStore($storeObj);
    $quoteObj->setStoreId($store_id);

    // Get cart instance
    $cart = Mage::getSingleton('checkout/cart');
    $cart->init();

    $productInstance = Mage::getModel('catalog/product')->load($productId);

    $request = new Varien_Object();
    $request->setData($param);
    $cart->addProduct($productInstance, $param);

    // update session
    $session->setCartWasUpdated(true);

    // save the cart
    $cart->save();

    $quoteObj->collectTotals();

    $quoteObj->save();
    // add the payment method
    $checkout = Mage::getSingleton('checkout/session');
    $quote = $checkout->getQuote();
    $quote->getPayment()->importData(array('method' => 'purchaseorder'));
    $quote->collectTotals();
    $quote->save();
}

PLEASE HELP I will send good vibes, prayers, and good karma to you.

I WILL MAKE GRAND DONATION TO YOUR FAVORITE PERSONAL CHARITY!!!!!


texts: web setup wizard missing showing white page in magento 2.2.3

texts:
To use the Magento setup wizard I logged into  Admin account and navigate to
 System => Tools => Web Setup Wizard
But
https://dev.mywebsite.com/setup/
Url showing 500 Internal Server Error

I checked it in fresh version of magento2.2.3 on localhost it is working.
but on my server I upgraded my website in magento2.2.3 before few days so it is not working in my website of same version.


texts: How to remove city field from admin "Create New Order" Billing Address?

texts:
Hi I am working with magento 1.9.3

In admin panel I need to remove City field form Create New Order page (Both Billing and Shipping Address).

Can anyone suggest me please how I can do that?

For your convenient here is the screenshot:


texts: Can I be notified when my paypal authorization is set to expire?

texts: We have an online store built in Magento and in the Paypal config it is set to "Authorization" and not "Sale." We have to have it that way because we don't always have the part in stock but need to order it. Is there a way to be notified when the paypal authorization is about to expire? Its not in Paypals admin nor is it in Magentos admin for the notification.


texts:
Hi Currently I am getting tax class name as follows

$_product = $item->getProduct()
$taxClassId = $_product->getTaxClassId();
$taxClass = Mage::getModel('tax/class')->load($taxClassId);

Which is fine if it is not called in for loop. But my problem is that I am doing that in a for loop. Which is very expensive. I have a invoice collection and calling the above code block for each invoice.

What I want to be able to do is have a query that will fetch all the SKUS and its corresponding tax class names. Which I will load before the for loop and when I need it I will call it from array.

**SKU      Tax_Class_Name**
SKU_001  Taxable Goods
SKU_002  Taxable Goods
SKU_SHIP SHIPPING

I am not able to establish the correct tables so I can fire the query. catalog_product_entity and tax_class table will be needed but cannot find connection between the two.


texts: Magento list states and cities according to website specific for India

texts: How to list states and cities according to website specific for India


texts: Magento : Custom login form in Magento, redirecting back to some customers

texts:
I have created a custom login form for an app created in Magento some time ago. Everything worked fine until now. Some of the customers are redirected back to the login form after the login process - on their browsers (if I try to login with their credentials, it's working fine).

So, my guess was sessions and I logged them. Session got it in the correct way.

Login is simple, based on Magento login form:

if ($this->_getSession()->isLoggedIn()) {
        $this->_redirect('*/*/');
        return;
    }

    $login = $this->getRequest()->getPost('login');
    $session = $this->_getSession();
    /* do some password stuff */
    // here here
    $session->login($login['username'], $client_password);
    $this->_loginPostRedirect();

I tested their login and logged the session: Mage_Customer_Model_Session Object - everything OK, looks the same as any other customer sessions.

The last url var for this kind of users is /customer/account/loginPost/.

Only with this settings will work for me. If I will change them it will crash.

Cookie Path : /
Cookie Domain: *blank*

I repeat: For some customers everything works OK. Also, for the users with problems, I can login myself into the app. What could happen? I saved the sessions in files and then I saved them in db - same results.


texts: how show size attribute like button format instead of drop down in magento


texts:
When I click on image while adding new I didn't get any option to add image or upload image

Question is how can i add image for product?


texts: why there are block,controller, model directories in magento module?

texts: Can anyone explain why should we write our code in different directories while creating module? Can't we just write our block code in controller? if we put our model,block files in controller .will module work?


texts:
My website loading image like,

How can i change to,

Anyone help me, Thanks.


texts:
I have googled everywhere to find an answer to my issues.

  Loading composer repositories with package information

  [Composer\Downloader\TransportException]
   Your configuration does not allow connections to http://packages.firegento.com/packages.json. See https://getcomposer.org/doc/06-config.md#secure-http for details.

I can't find firegento in my composer.json in the .git repository anywhere.  This also seems to be only with my particular computer in our projects.  I am using OSX.


texts: Check if attribute equals specific value

texts:
I want to check that a product attribute equals a specified value in the product/view/list.phtml template and if so, display some html.

The current code gives no result. Can an edit be suggested to get it working in Magento 2.

CURRENT CODE

<?php if ($_helper->productAttribute($_product, $_product->getInStockMadeToOrder(), 'in_stock_made_to_order') == "This item is in stock") { ?>

In Stock

<?php } ?>


texts: How to break a event flow form an Observer and redirect to the same page in Magento 2?

texts:
How can I break a flow when some condition is true? Let's say the customer is writing a review for the product https://url/review/product/post/id/2/ and when the user presses the save butto some condition should be tested and if true the save process should not continue, and the user should be redirected to the same page with a error message ('your message could not be saved ....'.

For the moment I have the following code inside the observer:

public function execute(Observer $observer)
    {

        if($sometest === true){
            $this->messageManager->addError(__("you have an error in your string"));
        }
        //Avoid save and redirect to the same page
    }

What should I use in order to break the save process and redirect the user to the same page?


texts: Magento 2 - Rewrite url from custom module

texts:
In magento 1 I can rewrite url in my custom module etc/config.xml like this:

<global>
        <rewrite>
            <digi_url>
                <from><![CDATA[/digisearcher\/feed.xml/]]></from>
                <to><![CDATA[digi/index/index/]]></to>
                <complete>1</complete>
            </digi_url>
        </rewrite>
</global>

how can I achieve this in my Magento2 custom module?


texts: Does a complete "config.xml" reference exist?

texts:
I am in the process of writing some in-house documentation that goes a bit beyond the "hello world" examples that populate the internet and would like to start a complete reference wiki on some of the "copy and paste" parts that most tutorials gloss over.

Thus far the most complete reference that I have found is located at http://www.magentocommerce.com/wiki/5_-_modules_and_development/reference/module_config.xml but it is only 25% complete!

My question is plain and simple: where can I find more authoritative documentation on module configuration?


texts: Telephone field not getting displayed on front end

texts:
I want to display the Telephone field as required on the customer registration form. When it is not getting displayed on the front end.
Here are the screenshots.
https://prnt.sc/oumqt0
https://prnt.sc/oumr8c


texts: how can I set custom attribute value for entity (for product) in MFTF test

texts:
The selected customer attribute is not saving for created by MFTF product (https://prnt.sc/tqqy8m).
Let me know please.


texts:
How to upgrade magento enterprise edition. Unlike community edition enterprise edition does not have facility to upgrade from one version to another version using from Magento Connect. In Magento community edition we can upgrade from one version to newer version using magento connect and check for updates. If any updates found we simply check those modules and go for update.
In Enterprise edition if I choose check for updates in magento connect, nothing is coming out even though newer version is available.
So please let me know how to upgrade magento enterprise edition from older version to newer version.

Thanks in advance


texts:
I'd like to create a new custom category block, that will display it's subcategories. I have created a new file:

vendor/magento/module-catalog/view/frontend/templates/category/subcategories.phtml

and in my theme's category layout file:

app/design/frontend/domino/domino1/Magento_Catalog/layout/catalog_category_view.xml

I placed the following code:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Catalog\Block\Category\View" name="category.subcategories" template="Magento_Catalog::category/subcategories.phtml"/>
        </referenceContainer>
    </body>
</page>

Am I missing something?


texts: How to check product delivery from pincode using end point API MAGENTO-2

texts: I need one help. I need to know is there ant end point API available to check the delivery serviceability from pincode. User has its pincode as the input and need to check the  delivery serviceability of one product. I need the end point API for this.


texts: Product Image is not display on frontend Magento 2

texts:
I am facing this issue. Product image is not show on product page in magento 2.3.1

My backend is :

So Please help me !!!


texts: Get sub categories in A to Z order of a particular category

texts:
How do it get sub categories in A to Z order of a particular category in each  block and label them alphabetically. Note that A, B, C, etc. are just label.

For example:

A

A sub category 1
A sub category 2
A sub category 3

B

B sub category 1
B sub category 2
B sub category 3

C

C sub category 1
C sub category 2
C sub category 3


texts: Magento 2: How to get individual review rating

texts:
I'm trying to get each individual review rating on a product, but currently I am only able to return the product's overall average rating.

Here is what I have so far to build my collection of reviews in my block file:

<?php
namespace Company\Module\Block;

class Index extends \Magento\Framework\View\Element\Template
{
  protected $reviewCollection;

  public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Review\Model\ResourceModel\Review\CollectionFactory $reviewCollection,
    array $data = []
  ){
    $this->_reviewCollection = $reviewCollection;
    parent::__construct($context, $data);
  }

  public function getReviews($product)
  {
    $reviews = $this->_reviewCollection->create()->addStatusFilter(\Magento\Review\Model\Review::STATUS_APPROVED)->addEntityFilter('product',$product->getId())->setDateOrder();
    return $reviews;
  }
}

And then in my phtml file, I'm calling my block:

$reviews = $block->getReviews($product); // $product assigned earlier in code
if (count($reviews) > 0) {
  foreach ($reviews->getItems() as $review) {
    //get individual review summary here
  }
}

Not sure if I'm using the correct resource model in my block, maybe I need to build the collection of reviews differently?


texts:
I am embedding the contacts form onto a CMS page with this bit of layout XML:

<reference name="content">
<block type="core/template" name="cmsContactForm" form_action="/contacts/index/post" template="contacts/form.phtml"></block>
</reference>

However, when I am on that CMS page this bit of code on the contacts form page:

<form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post">

The getFormAction() method returns an empty string, resulting in the contact form failing as it just refreshes the page instead of submitting the information in the contact form.

Can anyone tell me how to get a proper form action from getFormAction()?

Is there a relevant helper that I can employ on a CMS page?


texts: Topic "inventory.source.items.cleanup" is not configured

texts: I try to upgrade my magento 2 but i got this problem, how can i solve ? thanks


texts: I want to create a box for customer to évaluate my store. The evaluation must be in the form of stars. If a guest is loged in so the évaluation is directly saved else the clic on the registratoion of the évaluation will redirect him to the login/register page. I searched on the net but did'nt find any information can you please help me find a solution thanks in advance :)


texts: Empty URL in cache_invalidate log entires

texts:
I'm monitoring the debug.log file to see when the cache for specific products get invalidated and I see frequent entries like this:

main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":["catalog_product_3971","FPC"],"mode":"matchingTag"},"is_exception":false}

The url is always "http:/". What does that mean? The invalidation wasn't initiated by any http request? If not then what?


texts: REST API - cant retrieve translated option values

texts:
The main goal for me is to retrieve an option with all its labels, or a call to update labels and leaving the rest of the labels as it was.

I cant find any, tried all the repo calls so far


texts: Magento 2 how to avoid ids for color attribute values?

texts:
I have imported products in magento 2 with color and size using csv, but we have deleted previous color values and did re-index and re-again  we have created new color values for the same color attribute and updated to the products, here something went wrong i am not sure facing one issue i.e when we export the data the color values are appearing with numbers (ids).

Could you please any on advise how to fix ?

Is this issue fix with Replace products with CSV?

please refer the screenshot below:-


texts: Any configuration for type of style section loaded in head tag?

texts:
Is there any configuration that makes style section loaded like this in head tag:

<style data-href="http://www.website.com/pub/static/frontend/Mytheme/mytheme/fr_FR/mage/calendar.css" media="all"> ....</style>

Instead of like this:

<link rel="stylesheet" type="text/css" media="all" href="www.website.com/pub/static/frontend/Mytheme/mytheme/fr_FR/mage/calendar.css" />

In fact, I want it to be a link tag like by default, but maybe a configuration makes it changed to inline style tag, and I can not find what configuration has been changed.


texts: Magento 2 how to receive a webhook body?

texts:
I'm doing an integration with a system called Sift Science.

What I need to accomplish is to receive a response whenever someone in Sift Science performs an action (for example> Approve account, ban account).

I can set web-hook URL in the service, but I don't how to receive the response.

I tried to receive it in a controller , because as far as I know web-hooks sends posts with json format, please correct me if i'm wrong.

In web-hook URL I set the controller path, and I'm using the following method to receive it>

$post = $this->getRequest()->getPostValue();

But had no luck.


texts: Magento 1.9 Shopping Cart Price Rule apply issue

texts:
I'm struggling with an issue regarding the Shopping Cart Price Rules.
I've created a rule with a single coupon and the only condition is Subtotal is equal or greater than 65,50.

When I'm using this coupon Magento say "This coupon was successfully applied." but at least the totals still the same and the coupon doesn't seem to be applied.

What I understood: Actually in the cart totals we have two rows, Subtotal without taxes, and Subtotal with taxes.

Let's assume that we have a Subtotal WITH taxes of 66,00 (so the coupon can be applied, in theory) and a Subtotal WITHOUT taxes of 60,00.

In that situation, if I try to apply the coupon I get a positive response but it doesn't seem to be applied.

The only way for applying this coupon is to add more products so the SUBTOTAL WITHOUT TAXES will be greater than 65,50.

It seems that the condition of the rule is based on the Subtotal without taxes, and not to the Subtotal with taxes.

Obviously, in the backend, the rule is configured in a correct way, for apply the coupon at the prices with taxes.

Some of you faced the same issue? I'm trying to understand if it is a problem of a specific module or theme or maybe is anything else.

Thanks in advance and if you didn't understand something, feel free to ask ;)

SOLVED: Was a custom-old module that was removing the coupons from the addresses, removing that function worked for me. Now the subtotal considered is the one with taxes, and the calculation works fine.


texts: Product Suggestions Based On Custom Customer Attributes

texts:
Within our Magento shop customers don't really know what they need to buy. Therefore we want to give customers suggestions and advice what kind of product they could buy in our shop based on some input of custom attributes from our customers.

To determine this advice we want to define and collect several custom customer attributes.

Customer Data:

+------------+--------+--------+--------+--------+
|            | attr_1 | attr_2 | attr_3 | attr_4 |
+------------+--------+--------+--------+--------+
| Customer 1 |    2   |   10   |    3   |    2   |
+------------+--------+--------+--------+--------+
| Customer 2 |    8   |    3   |    4   |    4   |
+------------+--------+--------+--------+--------+
| Customer 3 |    5   |    2   |    3   |    9   |
+------------+--------+--------+--------+--------+
| Customer 4 |    4   |    2   |    1   |    4   |
+------------+--------+--------+--------+--------+
| Customer 5 |    3   |    8   |    2   |    2   |
+------------+--------+--------+--------+--------+

We want to find which customers are similar to each other.

Input:

+------------+--------+--------+--------+--------+
| Customer x |    7   |    4   |    4   |    4   |
+------------+--------+--------+--------+--------+

Output:

"Most Similar To Customer 2"

And based on the order history of customer 2 (and other similar users) we want to give buying advice.

Are there any best practises or any packages/extension which could help us further?


texts:
We are running on magento 1.9.3.2 and usually know how to configure cart discount rules in 1.8 properly. In the new installation we have the following problems:

when we add "free shipping" to the code and use it, it is not marked as used in the backend and be be reused
When I use a specific code, again with free shipping (that is then properly applied) and return from the last onecheckout display to the cart and revoke the coupon code it is still applied, so revocation does not work
when I define a discount with free shipping and zero product discount and use it it stays persistant for all consecutive purchases.


texts: Add validation to a checkout field from my module

texts:
I know I can add validations in the checkout_index_index.xml like this:

<item name="validation" xsi:type="array">
    <item name="validate-jurgis" xsi:type="string">true</item>
</item>

I could just override this file from my module, but I am looking for a more flexible way to do this.

Is there a way to just "add" the validation to a checkout field without overriding the entire checkout_index_index.xml?


texts: Magento Total saleble qty displays wrong count

texts:
I've magento setup with MSI with 2 sources and both are assigned to stocks as well.

But In product grid Total Salable Qty displays wrong count.

It suppose to be sum of total available sources.

Check below screen.

Here is screen of product form.

Anyone has gone through it ? Any help would be appreciated.

Sources Configurations

Stock Configurations


texts: import parent and sub category with csv magento 1.9

texts:
I am uploading a CSV in Magento 1.9, and what i need is to import both categories and sub-categories, but now it is currently importing only sub-categories. Here is an example of how I the categories are defined.

Sports & Fitness /Fitness Accessories

Thanks in advance


texts: How to change the URL without page reload in Magento

texts: I am developing a site like http://charitybuzz.com using Magento. If you can check they have shown all the products in home page and by clicking on a category the page URL changes but without any reload. I need the same thing done on my site, Can anybody help me out?


texts: Conceptually speaking, management interfaces are used for what?

texts:
For example

Magento\Catalog\Api\ProductManagementInterface
Magento\Catalog\Api\ProductLinkManagementInterface

They are used for very specific tasks?


texts: data scraping for categories and products

texts:
I want to scrape a data from one of ecommerce website.

Where i want to pull all categories and products details.
What will be the best method to do it?


texts: Magento 2.3 :: Does checkout handles concurrent requests?

texts:
Magento version: 2.3.1

We do flash sale for a particular product on our website on fixed date and time.

The product quantity is limited.

A lot of customers try to purchase the product at the same time.

We end up overselling the product.

My suspicion is Magento do not handle thread safety and thus concurrent requests are allowed to purchase the product.

For example, last quantity is remaining and two requests were received at the same time (this is a normal scenario in flash sales).

Then, will the method: $stockItem->getIsInStock() return true for both?


texts: Quickbook integration and getting access token

texts:
I am using the quickbook php sdk. I am facing the problem to get a token

   $dataService = DataService::Configure(array(
          'auth_mode' => 'oauth2',
          'ClientID' => "XX",
          'ClientSecret' => "XX",
          'RedirectURI' => "http://localhost/naik/",
          'scope' => "com.intuit.quickbooks.accounting",
          'baseUrl' => "https://sandbox-quickbooks.api.intuit.com"
    ));

    $OAuth2LoginHelper = $dataService->getOAuth2LoginHelper();

    $url = $OAuth2LoginHelper->getAuthorizationCodeURL();

    header('Location: '.$url);

As per their documation i have to write the location to the url. When i run this code in my controller it does not show anything


texts: Cannot add custom source_model into widget

texts:
I tried to add new custom source_model (select).
My config.xml:

<config>
    <modules>
        <Pixels_UniversalPixel>
            <version>1.0.0</version>
        </Pixels_UniversalPixel>
    </modules>

    <global>
      <models>
         <universal_pixel>
            <class>Pixels_UniversalPixel_Model</class>
         </universal_pixel>
      </models>
    </global>

</config>

My widget.xml:

<widgets>
    <universal_pixel type="universal_pixel/pixel">
        <name>Universal Pixel</name>
        <description type="desc">Adds a universal pixel</description>
        <parameters>
            <require_consent>
                <label>Require consent</label>
                <type>select</type>
                <required>1</required>
                <visible>1</visible>
                <value>1</value>
                <source_model>universal_pixel/system_config_source_gdpr_states</source_model>
            </require_consent>
        </parameters>
    </universal_pixel>
</widgets>

And my model src/app/code/local/Pixels/UniversalPixel/Model/System/Config/Source/GDPR/States.php :

<?php

class Pixels_UniversalPixel_Model_System_Config_Source_GDPR_States
{
    public function toOptionArray()
    {
        return array(
            array(
                'value' => 0,
                'label' => 'No consent',
            ),
            array(
                'value' => 1,
                'label' => 'Require consent',
            ),
            array(
                'value' => 2,
                'label' => 'Require consent in EU only',
            ),
        );
    }
}

But it doesn't work. Where is my mistake. Thanks in advance.


texts: how to replace image url get by wysiwyg editor in Magento 2.3.5

texts:
I got image like this from uploding image by wyusiwyg editor:
<img src="{{media url="http://example.com/media/wysiwyg/the-picture.jpg"}}" alt="" />
but i want to replace this url like this:

and i want to do this using helper in custom module.
Please anyone can have idea then share with me.
Thank you in Advance.


texts: Need Suggestion about categories and structure

texts:
I need some suggestion about the structure of our categories, it maybe will be different in Magento than in our actual Amazon Webstore.

We are moving away from Webstore, and we build up a new Magento shop.

At the moment we have the follow categories in our actual shop:

http://www.outdoorequipped.com

All categories are in the navigation.

I was thinking, we just can take over the same structure as we already have. But then I came into the follow issues:

We like to show only a few "main brands" in the main navigation. All other brands we like to point to a "All Brand" page, with a listing of all brands we have.
A product can be either in a categorie (brand categorie) not shows up in the navigation (maybe not a main brand), but can shows up in an activity categorie.

How we need to set and import our products?
Do I need to create subcategories under "view all brands", so that they not shows up in the main navigation?

Here is our new designed shop: http://mag.outdoorequipped.com

Any suggestions?


texts:
I've successfully created a new field on the frontend with an extension_attribute by this documentation.

My problem is that where should I hook the extension attributes on the admin page?

The shipping method is set by Magento_Sales/order/create/scripts.js with the Adminorder.setShippingMethod mehod.

But this is a prototype file, I can not hook on it with mixin, since it has no return value.

How can I add/get the extension_attributes with my value?


texts:
I've created a file called page.xml that contains the action method and addJs of the file.

This page.xml file is saved in /app/design/frontend/default/blank/layout and looks like:

<?xml version="1.0"?>
<layout>
  <default>
    <reference name="head">
      <action method="addJs"><script>custom/progress.js</script></action>
    </reference>
  </default>
</layout>

I have put the JS file in the main js folder at root under custom/progress.js

When i load the page, no JS file loads up, and I have no idea what file i need to actually edit.

Joomla is so much better at being able to add JS files, why isn't it easy in Magento?

Someone please help me! Also, it's stupid that you can't paste any code here.


texts: Magento 2 passing more argument in Model

texts:
How can i add more argument \Magento\Backend\Model\Auth\Session $authSession
into \Magento\Store\Model\Website ?

I tried to get current user like following link:
Magento 2: How to get current admin user detail?

and it gave me error log:

Recoverable Error: Argument 14 passed to Magento\Store\Model\Website::__construct() must be an instance of Magento\Backend\Model\Auth\Session, array given, called in D:\tait_magento\trunk\var\generation\Magento\Store\Model\Website\Interceptor.php on line 14 and defined in D:\tait_magento\trunk\vendor\magento\module-store\Model\Website.php on line 199.

Block dashboard throws exception and cannot be rendered.

And i have search and do everything from clearing /var/* folders or
config di.xml but i can't have any results.

Please help me , the beginner with Magento 2.

This is my code:

    namespace Magento\Store\Model;

     class Website extends \Magento\Framework\Model\AbstractExtensibleModel implements
        \Magento\Framework\DataObject\IdentityInterface,
        \Magento\Framework\App\ScopeInterface,
        \Magento\Store\Api\Data\WebsiteInterface
    {

    ....

         protected $_authSession;
         public function __construct(
                \Magento\Framework\Model\Context $context,
                \Magento\Framework\Registry $registry,
                \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
                \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
                \Magento\Config\Model\ResourceModel\Config\Data $configDataResource,
                \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig,
                \Magento\Store\Model\ResourceModel\Store\CollectionFactory $storeListFactory,
                \Magento\Store\Model\GroupFactory $storeGroupFactory,
                \Magento\Store\Model\WebsiteFactory $websiteFactory,
                \Magento\Store\Model\StoreManagerInterface $storeManager,
                \Magento\Directory\Model\CurrencyFactory $currencyFactory,
                \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
                \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        //        \Magento\Backend\Model\Auth\Session $authSession,
                array $data = []
            ) {
                parent::__construct(
                    $context,
                    $registry,
                    $extensionFactory,
                    $customAttributeFactory,
                    $resource,
                    $resourceCollection,
                    $data
                );
                $this->_configDataResource = $configDataResource;
                $this->_coreConfig = $coreConfig;
                $this->storeListFactory = $storeListFactory;
                $this->_storeGroupFactory = $storeGroupFactory;
                $this->_websiteFactory = $websiteFactory;
                $this->_storeManager = $storeManager;
                $this->_currencyFactory = $currencyFactory;

                //$authSession = new Session();
               // $this->_authSession = $authSession;
            }

            protected function _construct()
            {
                $this->_init('Magento\Store\Model\ResourceModel\Website');
            }

            public function getCurrentUser()
            {
                return $this->_authSession->getUser();
            }
......
    }


texts: Pass the values to rest api from magento2 checkout page

texts:
Get the values from magento2 checkout page but I need to pass into the rest api. How to pass the values.

*$params =   array( 'OrderLineId'=>$orderLineId,
                        'MaterialNo'=>$materialNo,
                        'PlanType'=>$planType,
                        'Qty'=>$qty,
                        'UnitPrice'=>$unitPrice,
                        'UnitTax'=>$UnitTax,
                        'DiscountRate'=>$DiscountRate,
                        'Discount'=>$Discount,
                        'OrderId'=>$orderId,
                        'StoreId'=>$storeId,
                        'PartnerId'=>  $partnerId,
                        'CustomerId'=> $customerId,
                        'OrderType'=> $orderType,
                        'OrderSource'=>  $orderSource,
                        'CurrId'=> $currId,
                        'UserName'=> $userName);
                        $data = json_encode($params);
$ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch,CURLOPT_HEADER);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
            $response = curl_exec($ch);
            curl_close($ch);

         } catch (Exception $e) {
             echo $e->getMessage(); exit;
              }

Can you anyone please help me.


texts:
I just need some direction, please… I feel lost.

Basically I'm using Magento 1.7 & I’m working on a module that gives a customer an option to add gift wrapping during the onepage checkout process.  I’m up to the point where I need to change the checkout total to reflect the change in price (and of course I would like to do this the right way.)

Looking at the frontend, I want to change this (under Order Review):

Subtotal $54.00
Shipping & Handling (Flat Rate - Fixed) $20.00
Grand Total $74.00

To this:

Subtotal $54.00
Gift Wrap $5.00
Shipping & Handling (Flat Rate - Fixed) $20.00
Grand Total $79.00


texts: Why would the order I call SOAP services matter?

texts:
New Magento developer here! I was getting the fatal error: "looks like we got no XML document" when adding a product through SOAP with sets of attributes, pictures, stock etc., after many hours of trying to fix it I finally re-ordered the calls to the SOAP services in the WDSL endpoint, and it started to work! Here's my code that didn't work;

$soapClient = new SoapClient($magento_service_url."/soap/default?wsdl&services=catalogCategoryRepositoryV1,catalogCategoryLinkRepositoryV1,catalogCategoryManagementV1,catalogProductAttributeOptionManagementV1,configurableProductLinkManagementV1,catalogProductRepositoryV1,catalogProductAttributeRepositoryV1,configurableProductOptionRepositoryV1,catalogCategoryAttributeRepositoryV1,catalogAttributeSetRepositoryV1,catalogProductAttributeMediaGalleryManagementV1",['version' => SOAP_1_2, 'stream_context' => $context]);

And here's the line that does work;

$soapClient = new SoapClient($magento_service_url."/soap/default?wsdl&services=catalogProductAttributeOptionManagementV1,configurableProductLinkManagementV1,catalogProductRepositoryV1,catalogProductAttributeRepositoryV1,configurableProductOptionRepositoryV1,catalogCategoryRepositoryV1,catalogCategoryLinkRepositoryV1,catalogCategoryAttributeRepositoryV1,catalogProductAttributeMediaGalleryManagementV1,catalogAttributeSetRepositoryV1,catalogCategoryManagementV1",['version' => SOAP_1_2, 'stream_context' => $context]);

Same calls, different order. The variables have the same values also. Why would the order that I make the calls matter? Hopefully the answers here will also help other people too!

I'm using Magento 2.3.5 on Ubuntu


texts: Magento 2: How to insert the checkout & cart link in phtml?

texts:
Magento version: 2.0.0

I try to add the checkout & cart page link to the page header not the toplink, so what's the link of them?
I searched my question and got a solution that add a block into the default.xml, but I don't know how to use it in phtml file. so, how to use it?

<block class="Magento\Framework\View\Element\Html\Links" name="top.links">
                <block class="Magento\Framework\View\Element\Html\Link\Current" name="my-link">
                    <arguments>
                        <argument name="label" xsi:type="string" translate="true">My Cart</argument>
                        <argument name="path" xsi:type="string">checkout/cart</argument>
                    </arguments>
                </block>
                <block class="Magento\Framework\View\Element\Html\Link\Current" name="my-link1">
                    <arguments>
                        <argument name="label" xsi:type="string" translate="true">Checkout</argument>
                        <argument name="path" xsi:type="string">checkout</argument>
                    </arguments>
                </block>
            </block>


texts: Check whether a skin file actually exists

texts:
I want to check if a file exists in any skin and thus the result of $block->getSkinUrl('foo.png') points to a valid URL.

How can I accomplish that?


texts: how to provide data source for sales order grid using ui component in magento2 frontend

texts:
The grid basically should contain sales order basic details such as order number, order status along with it should contain number of invoiced items, number of shipped items, number of invoices along with invoice numbers.
I know how to create ui component, but getting data from other tables such as sales_order_item,invoice table seems difficult.
can anyone help me on this.
Let's say 1 order contain sku1 10 ,sku2 20,sku3 30 .
Shipped items ( sku1 3 + sku2 4 +sku3 6) = 13
Invoiced items ( sku1 6 + sku2 10 + sku3 10) = 26
cancelled items ( sku1 1 + sku2 6 + sku3 14 ) = 21
Also concern about performance, because for each order we need calculate and need to provide data to the grid.
Offcourse we will add current customer as one filter.
Also we need to list number of invoices for that order,let's say it contains 4 partial invoices ( 000234,000235,000236,000237)
do we need to create separate read model for using cqrs , message queues?
or any custom indexer is enough?
also user should be able to filter & search with order item name or category as well.
so do we need to add this information to elastic search index  to get better performance


texts:
im having a issue on the tracking number popup (admin and frontent), it keeps giving me 404, so i tried to track from the source of mage that makes that functionality and show the tracking information that is:
app/code/core/Mage/Shipping/controllers/TrackingController.php

I tried to print the info to check if the info is returning on 2 methods:
ajaxAction() and popupAction()

But it keeps giving me a 404 on the popup, i tried to see if there is a third parties  module overwriting these functions but didnt find anything, can someone tell me if there is a issue on the repo about this issue? I tried to check it but no info i found it about it.


texts:
I need to show a page with out having the admin user log in.  They need to move from

http://local.mage.dev/index.php/admin/

http://local.mage.dev/index.php/admin/wsu/requestaccess/

With out loggin in.  As of right now, I just see the login page when I go to the requestaccess action URL.  I need to be able to show a form.  I have not yet found a way to say it's ok show this stuff yet. This is what I have in my controller, and althou I get to the url as I needed to, the page should be showing the login form.

app\code\local\Wsu\Adminldap\controllers\Adminhtml\WsuController.php

<?php
class Wsu_Adminldap_Adminhtml_WsuController extends Mage_Adminhtml_Controller_Action {

    /**
     * Forgot administrator password action
     * Request Access
     */
    public function requestaccessAction() {
        echo "test";
        die();
    }

    /**
     * Check if user has permissions to access this controller
     *
     * @return boolean
     */
    protected function _isAllowed(){
        return true;
    }
}


texts: Update Admin module to add fields problem

texts:
REWRITE: Ok rewriting this to make it clearer.

I have created a custom module using this (http://www.silksoftware.com/magento-module-creator/). It works fine however I needed to expand the module after i created it.

I went into my database, went into this modules custom database table, added the required entries and then from this generated the create SQL, I went into the module and added in 2 more text fields that were required, updated the database create in the install to reflect the new structure, uploaded it and cleared the cache. However it did not update the admin side.

I then recreated the module in the tool linked above, as an update with the new SQL I just generated as an update, with the new fields. and uploaded this (note this has worked repeatedly for me before on my other modules). Uploaded this and cleared the cache like I usually would and it did not work once again.

I then tried again with the tool with a much higher version number just to see if this would force the update, it did not work.

I then started faffing about, deleting the core_resource row, clearing the cache, deleting the VAR folder, uninstalling the module then re installing it from a base 0.1.0 with the new fields.

However no matter what I do once I pop the module files back onto my site the site just remembers the old structure and shows me that.

I also tried disabling the module before deleting and clearing the cache, then when re installed the module is re installed as disabled. so it's not being fully removed.


texts: Programmatically updating quote items in magneto2

texts:
I'm trying to update quote programmatically.
In controller file:
 public function execute()
        {
    $id = 298;

    $params['id'] = 298;
    $params['product'] = 6765;
    $params['selected_configurable_option'] = '';
    $params['related_product'] = '';
    $params['form_key'] = 'S3Tlt9UviUqCPaIu';
    $params ['super_attribute'] = array('135' => '608');
     $params['qty'] = 3;

    if (!isset($params['options'])) {
        $params['options'] = [];
    }
    try {
        if (isset($params['qty'])) {
            $filter = new \Zend_Filter_LocalizedToNormalized(
                    ['locale' => $this->_objectManager->get(
                        \Magento\Framework\Locale\ResolverInterface::class
                )->getLocale()]
            );
            $params['qty'] = $filter->filter($params['qty']);

        }

        $quoteItem = $this->cart->getQuote()->getItemById($id);
        if (!$quoteItem) {
            throw new \Magento\Framework\Exception\LocalizedException(__('We can\'t find the quote item.'));
        }

        $item = $this->cart->updateItem($id, new \Magento\Framework\DataObject($params));

        $this->cart->save();}

what can i do?


texts: How to redesign the product list in magento homepage?

texts:
Product list show in homepage is like below:

But, i want it shows like this :

How?


texts: Magento 1 - Fresh 1.9.4.5 style not loading

texts:
I just installed a fresh Magento 1.9.4.5, but the style is not loading. This is the web setup wizard:

I am using PHP 5.6


texts:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$configLoader = $objectManager->get('\Magento\Backend\Model\UrlInterface');
$url = $configLoader->getUrl('testing/queue/purchase');

<script>
require([
    'jquery',
    'mage/mage',
    'mage/calendar'
], function($){

    $('#customer_company').on('change',function(event){

        $.ajax({
            url: '<?php echo  $url ?>',
            type:'POST',
            showLoader: true,
            dataType:'json',
            complete: function(response) {
                console.log(response);
            },
            error: function (xhr, status, errorThrown) {
                console.log('Error happens. Try again.');
            }
        });
    });
});

i write this code in magento admin on change the ajax request call and its hit my controller but in console the response is Invalid Form Key. Please refresh the page


texts: Can't remove discount code Magento even when deleting code at checkout.xml

texts:
i can't get rid of the discount and estimate code at checkout in Magento 1.9. I removed the code from :  /app/design/frontend/your_package/mytheme/layout/checkout.xml tried even with core files and still keeps showing it, i always remove the discount code like this with no problems but for some reason i can't now.

Also tried App --> Design --> Frontend --> Base -- > Default --> Template --> Checkout --> cart.phtml and comment "getChildHtml('coupon') ?>

I am really clueless, any help would be appreciated.


texts: Magento is caching 'catalog_controller_product_view' event

texts:
I am working on a magento extension used for analytics purposes which requires functionality which responds to a variety of Magento events.

One of these events is catalog_controller_product_view which I need to extra the product data and do something with (I have no problems with this bit).

The issue I have is after the first time viewing a product Magento no longer raises the catalog_controller_product_view event for my Observer execute method is never called.

I have logged every Magento event as a debugging measure and the catalog_controller_product_view is definitely not being raised on every product view only the first one per product. In addition I can't see any event to hook into, Ive tried injecting the Request Interface and getting the request response which may contain product data but no luck.

Any ideas how to solve this?

Event.xml

<event name='catalog_controller_product_view'>
        <observer
                name='Path/To/Observer/ViewProduct'
                instance='Path/To/Observer/ViewProduct'
        />
</event>

Existing Observer (Path/To/Observer/ViewProduct) relevant lines:

$event = $observer->getEvent();
$product = $event->getData('product');
// do something with $product

To clarify what I'm after I need a way to accurate retrieve a product view regardless of caching, or a way to add the event to cache exceptions (if possible).


texts: Installation hangs while installing data

texts:
I tried to install magento 2 and it hangs while loading module Module 'Magento_CustomerSampleData':

Here is my Environment:

Ubuntu 14.04
Ngix
MySQL
I have attached a screen for reference.


texts: Magento2: How to get admin details on front side?

texts:
I have added  login as customer extension.

When I login to customer from admin panel then I want also admin details on front end side. who admin login as customer.

My Magento v2.0.17


texts: how to display 404 page throgh config if custom module is disabled by custom admin

texts:
I am trying to show 404 error page whenever custom module has disabled by custome admin page .
In single page we put 404 error template  directly but more than one page if i want to show same 404 error page what i do


texts: Can't import cross-sell when cross-sell sku contains space

texts:
In "System, Import/Export, Dataflow Advanced Profiles" I have a profile for importing Cross-sell. It works fine; however when the cross-sell SKU contains space it is not imported. The product itself can contain SKU, but not the associated cross-sell item.

The .csv file looks like this:

store;sku;crosssell
admin;DD IN;ES-1,DD OT,LB EB
admin;DD OT;ES-1,ES-2,ES-3

...where the first item (DD IN) will only import ES-1 as cross-sell because the other two items fail due to spaces in SKU, while the second item (DD OT) will import all three cross-sell items (ES-1, ES-2, ES-3) because they don't contain space in SKU.

The profile execution log-window does not report any errors.

I've tried to put the sku's within single and/or double quotes, without luck.

Is there any way to bypass this issue?

The XML-script for importing the cross-sell looks like this:

<action type="dataflow/convert_adapter_io" method="load">
    <var name="type">file</var>
    <var name="path">var/import</var>
    <var name="filename"><![CDATA[import_products_relations.csv]]></var>
    <var name="format"><![CDATA[csv]]></var>
</action>

<action type="dataflow/convert_parser_csv" method="parse">
    <var name="delimiter"><![CDATA[;]]></var>
    <var name="enclose"><![CDATA["]]></var>
    <var name="fieldnames">true</var>
    <var name="store"><![CDATA[0]]></var>
    <var name="number_of_records">1</var>
    <var name="decimal_separator"><![CDATA[.]]></var>
    <var name="adapter">catalog/convert_adapter_productimportrelations</var>
    <var name="method">parse</var>
</action>

Any help appreciated. Thanks!


texts:
Can anyone explain what are the differences between two?

I have searched a lot but didn't get any clarity, anyone here who is using can explain, please.


texts: someone attacking my site by causing too much traffic...hosting says to: "make sure all your files and folders have correct permissions"

texts:
Magento 1.9.1.0 with the Porto theme

VPS with:

SSD hard disk
6144 MB of RAM
8 Cores CPU

The load has been very high - it started yesterday where it was consistently around 20. I contacted the hosting and they kept saying I just need a dedicated server blah blah but it worked fine before (for years and even on worse hardware than what I have now).

Today - they wrote me this:

Currently the load on the server was high due to our server being hit from this IP: 64.20.37.67. It had 553 hits on our website in less then an hour.
This looked like an attack so they blocked it from our server.
We have also many hits from all kinds of bots, and when they have too many requests at the website at once it also causes the load to spike. Should I/can I block all the bots except for Google? They do recommend that I should: "...check your website and protect it a bit more in regards to unknown bots."
I suppose to make sure all of my files and folders have correct permissions (folders 755, and files 644) since unsecured permissions can also get our website under attack. How is it with the file and folder permissions? Which ones need the 777 and which ones don't?

Any other suggestions? :-*


texts: How to print raw sql query by applying filter on searchCriteriaBuilder in Magento 2

texts:
How to print raw SQL query by applying filters on searchCriteriaBuilder ?
I am using the following method, but it's giving error: "Uncaught Error: Call to undefined method Magento\Framework\Api\Search\SearchCriteriaBuilder::getSelect()"
echo $this->searchCriteriaBuilder->addFilters($searchCriteria)->getSelect();

Please help.


texts: Including generated 3rd party PHP library in Magento2

texts: I am creating a module that connects to a SOAP service, I have generated classes for this service using wsdl2phpgenerator which uses autoload.php. Placing this in "lib/" with the correct class namings makes it easy to include in Magento 1.9. How do I go about including these classes in Magento2?


texts: Avoid conflicts in setup scripts with multiple developers

texts:
We are using Magento setup scripts located in the sql and data directories to propagate data changes to all working copies and environments. This includes configuration settings, creation of new tables, attributes and so on.

[Update] Project-specific code goes into several Client_Module extensions.

Nonetheless often enough we need to add data migrations (i.e. setup scripts) which can't be attributed to an existing extension. Thus we use a Company_Client module (or Client_General, someting like that) for these changes.

Imagine multiple developers working on the same project at the same time. It may happen that developer A and developer B are both bumping the version number of Company_Client and create a new upgrade script. Even if you update your working copy frequently, you will get conflicts more often than you like, have to change the version of your local Company_Client extension and make sure that the scripts of your fellow colleagues run when you fetch their changes.

Three solutions from the top of my head:

Create many extensions for project-specific parts (pollutes the code pools with many unnecessary extensions).
Create one extension per developer for upgrade scripts (may work, but doesn't make sense).
Bite the bullet and manually do that kind of conflict resultion I explained before.

How do you handle this?


texts:
I want to install this dial but I do not understand or obtain GIT_USER_ID and GIT_REPO_ID.git

https://github.com/netz98/magento2-swagger-api-client-demo

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}


texts: How to create unpaid invoice programmatically

texts:
I am creating an invoice by running cron job after order completion, but it creates an invoice with status 'Paid'. I want invoice to be created with status 'Pending'.
This is the code i am using for creating invoice

$invoice = $order->prepareInvoice();
$invoice->register();
Mage::getModel('core/resource_transaction')
    ->addObject($invoice)
    ->addObject($invoice->getOrder())
    ->save();


texts: jQuery onchnage function call in magento 2.3

texts:
How to use custom js in Magento 2.3 add jquery
jQuery('.customdrop select').on('change',function(){
    console.log(jQuery('.customdrop select').find(":selected").text));
    if (jQuery('.customdrop select').find(":selected").text() === 'Other'){
        jQuery('.customfields').show();
    } else {
        jQuery('.customfields').hide();
    }
});


texts: Joining table to collection doesn't work but getData shows joined fields

texts:
The problem

I have joined the category product list collection (getLoadedProductCollection from Mage_Catalog_Block_Product_List) with a custom table. Because this collection is loaded from _beforeToHtml we have to update it via observer event:

<frontend>
    <events>
        <catalog_block_product_list_collection>
            <observers>
                <promotion_list_collection>
                    <class>promotion/observer</class>
                    <method>catalogBlockProductListCollection</method>
                </promotion_list_collection>
            </observers>
        </catalog_block_product_list_collection>

I am using this as my join:

public function catalogBlockProductListCollection($observer)
{
    $collection = $observer->getEvent()->getCollection();

    $collection->addAttributeToSelect('sku');

    $collection->joinTable(
        array('promotion'=>'custom_promotion'),
        'sku=sku',
        array('up_coupon_upc'=>'up_coupon_upc')
        );

}

But it turns out that that after it is loaded the column up_coupon_upc is not added to the collection. It is, however, available if you $collection->getData() to dump the contents of the loaded collection.

Things I've tried

I assumed that perhaps it wasn't actually adding to the MCMP model in the collection, so I have tried adding the attribute to the select:

    $collection->addAttributeToSelect('up_coupon_upc');

Doesn't work. I tried using various aliases. I tried using $collection->getSelect()->join() instead with the same result.

I also have tried to define other columns - none of which show up either. Doing array('*') adds all columns to my SQL query, but none of the attributes actually show up, though
the SQL output from $collection->getSelect() outputs exactly the correct query.

Guesses

I'm guessing that the modification of the collection is actually taking place either only within the scope of the Observer, or the product collection is somehow being load-ed prior to my observer being called.

Or, perhaps I'm just having a monumental fail and I've missed something obvious .


texts:
In my Customer account menu one of the links gets me redirected to the main customer account page. When I check with Firebug, I see that the status code of the request is 302 Moved Temporarily and then immediate request to the other page.

This happens when I activate the Itabs_Subcustomer module. Any ideas?


texts:
We run an online fishing lure store, there are several people involved in creating and sending out our products. I need to send a customers order from our store to multiple email addresses so an order can be processed. Is there a way I can do this? I know that you usually use a comma or semi-colon to separate multiple email addresses but it does not allow me to do this in Magento.

Can anyone please help with this.


texts:
This is the general layout for all pages. In page.xml, there is this code

<default translate="label" module="page">
  <label>All Pages</label>
    <block type="page/html" name="root" output="toHtml" template="page/1column.phtml">
      <block type="page/html_head" name="head" as="head">
        <action method="addCss"><stylesheet>css/styles.css</stylesheet></action>

Now in page/1column.phtml, there is this code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<head>
<?php echo $this->getChildHtml('head') ?>
</head>

So I'm pretty sure <?php echo $this->getChildHtml('head') ?> starts including the contents of head block in page.xml, e.g. css/styles.css. Somehow in the view source, there is all the content in head.phtml between <head> and css/styles.css, but I have no idea what is putting it there. I don't see anything setting head.phtml in this layout file or local.xml. Does anyone know where this template is included in code? I think finding this will help me uncover a bug I'm experiencing..


texts:
i am facing problem for paypal.
I have enable multi currency option including Taiwan , Singapore , Australian currency etc.
if i select Singapore dollar as display currency and went for checkout , pay-pal showing USD in checkout page. cosotmer are not able to pay as per display currency
Kindly help me
Note - Base currency is USD ,
Display/allowed currency is as mentioned above.. Kindly guide me what is the problem


texts: Magento 2: In which phtml file Footer content is defined?

texts: I want to remove this class. Can anyone help me out to find out the class ?