texts: Offline credit card processing - displaying CVV number

texts:
I am developing a Magento website for my customer. He wants to process credit card payments offline, but in order to do this the customers' CVV number has to be displayed in the Orders section of the Admin section. Can this be done, please? I have told my client that storing of such payment information is not PCI compliant but he insists that this is the way he wants to go and he is intending to delete the CVV number each time an order is processed.

I would be very grateful if someone could suggest away to achieve this objective.

Many thanks,

Clive


texts: Create Custom POST form without grid and model in magento 2

texts:
I need a custom post form in Magento back-end where I can select some fields and post form , on its post action I need to download a csv depending on form fields.

This post form has dependable fields which may vary according to previous selection.

I have checked many question where I found creating grids based on some data-provider with UI-component. In my case I don't need to create some new table or grid to display data.

I'm open for both ways UI-component and block way.


texts: Magento2 Multiwebsite Registration Is not working

texts:
i have created two website with single magento,
my default website registration is working ok.but my second website
registration returns
"Requested store not found " error

https://127.0.0.1/m2/customer/account/create : working good
https://127.0.0.1/m2/de/customer/account/create : not working
So help me to solve this issue


texts: Products Sold Report - Where does the Period column come from?

texts:
I'm looking to create a custom Magento Adminhtml report based on the Products Sold report (Reports->Products->Products Ordered in Adminhtml). I can see that the Products Sold report's Grid Block is Mage_Adminhtml_Block_Report_Product_Sold_Grid.

However, I'm obviously missing something, because the report has a period column, which isn't added to the report in the Grid block's _prepareColumns() function. Here are the other two columns being added in Mage_Adminhtml_Block_Report_Product_Sold_Grid:

protected function _prepareColumns()
{
    $this->addColumn('name', array(
        'header'    =>Mage::helper('reports')->__('Product Name'),
        'index'     =>'order_items_name'
    ));

    $this->addColumn('ordered_qty', array(
        'header'    =>Mage::helper('reports')->__('Quantity Ordered'),
        'width'     =>'120px',
        'align'     =>'right',
        'index'     =>'ordered_qty',
        'total'     =>'sum',
        'type'      =>'number'
    ));

    $this->addExportType('*/*/exportSoldCsv', Mage::helper('reports')->__('CSV'));
    $this->addExportType('*/*/exportSoldExcel', Mage::helper('reports')->__('Excel XML'));

    return parent::_prepareColumns();
}

My question is where is the Period column is coming from, and from where is it getting its data?


texts: Magento 2: Not transferring Item Name to paypal

texts:
is there a way for the PayPal express checkout module to not transmit the Item title/name to PayPal?

Example:

Current Status:
Item name transmitted to pp: Leggings 3/4 legs whatever blah blah Size L

  Expectation:
      Item name transmitted to pp: Brand + SKU (or any static name like website name would be cool too)

Any Help would be much appreciated.

D.C.


texts: I cannot see newly uploaded products in "Manage Products" in the admin

texts:
I uploaded around 100 new products by CSV but cannot see them in "Manage Products" in the admin (having no filters on the search). Strangely I can see them in the tables in the database and when I look at a category can also see them in "Products in Category". I have flushed the cache and reindexed the products.

I have used this technique many times before so it is quite baffling. I cannot find anything out there with these symptoms of this problem. Thanks to anyone that has either previously had this problem or can shed some light - suggestions, etc damn I'll take anything. Thanks.


texts: Need to update a single item quantity in cart data collection foreach loop in magento 2

texts:
I want to update the quantity of single product in whole cart coming from foreach loop and then save cart.
         foreach($quoteModel->getAllVisibleItems() as $it){
        $itemid=$it->getId();
        $sku=$it->getSKU();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $cart = $objectManager->get('\Magento\Checkout\Model\Cart');
         $cartId=$cart->getQuote()->getId();
        $cartitems = $quoteModel->getItemById( $it->getId());
        $cartitems->setquoteId($cartId);
        $cartitems->setitemId($it->getId());

    }

    $cartitems->save();  // Add code
    $quoteItems[] = $cartitems;
    $quoteModel->setItems($quoteItems);
    $quoteModel->collectTotals();


texts: Magento2 : Calculate shipping charge based on cart value in Store Pickup method

texts:
I am working on magento 2.1.3 and using storepickup plugin for shipping methods.

My shipping charge for store pickup is 5% of the cart value.

Also there is 16% VAT for all products and shipping charge and shipping charge and cart values are inclusive of VAT.

5% of shipping charge is working fine with normal situation.

But calculation is wrong when i am applying discount codes.

Then also its showing correct values on cart and checkout. But values are wrong on order email and backend.

Here is my code

File :  app/code/Vendor/Storepickup/Model/Carrier/Custom:

public function collectRates(RateRequest $request) {
    if (!$this->getConfigFlag('active')) {
        return false;
    }

    $freeBoxes = 0;
    if ($request->getAllItems()) {
        foreach ($request->getAllItems() as $item) {

            if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
                continue;
            }

            if ($item->getHasChildren() && $item->isShipSeparately()) {
                foreach ($item->getChildren() as $child) {
                    if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
                        $freeBoxes += $item->getQty() * $child->getQty();
                    }
                }
            } elseif ($item->getFreeShipping()) {
                $freeBoxes += $item->getQty();
            }
        }
    }

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $cart = $objectManager->get('\Magento\Checkout\Model\Cart');

    $subTotal = $cart->getQuote()->getSubtotal();
    $grandTotal = $cart->getQuote()->getGrandTotal();

$this->setFreeBoxes($freeBoxes);

    /** @var Result $result */
    $result = $this->_rateResultFactory->create();

    if ($this->getConfigData('type') == 'O') {
        // per order
        $shippingPrice = $this->getConfigData('price');
    } elseif ($this->getConfigData('type') == 'I') {
        // per item
        $shippingPrice = $request->getPackageQty() * $this->getConfigData(
                        'price'
                ) - $this->getFreeBoxes() * $this->getConfigData(
                        'price'
        );
    } else {
        $shippingPrice = false;
    }

    //$shippingPrice = $this->getFinalPriceWithHandlingFee($shippingPrice);

    if ($shippingPrice !== false) {
        /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */
        $method = $this->_rateMethodFactory->create();
        $method->setCarrier('storepickup');
        $method->setCarrierTitle($this->getConfigData('title'));

        $method->setMethod('storepickup');
        $method->setMethodTitle($this->getConfigData('name'));

        if ($request->getFreeShipping() === true || $request->getPackageQty() == $this->getFreeBoxes()) {
            $shippingPrice = '0.00';
        }

        $shippingPrice = $grandTotal * (5/100);

        $method->setPrice($shippingPrice);
        $method->setCost($shippingPrice);

        $result->append($method);
    }

    return $result;
}


texts: i want to limit category product on home page i use product_count,limit,Column_count but nothing work


texts: How do I pull customer, order, product, etc. data from Magento 2?

texts:
I'm trying to set up a simple script to pull customer, order, product, etc. data information from Magento 2.

I have an old script for Magento 1 that does this easily, and quite nicely, but with the total revamp of Magento 2 I'm lost in the weeds again.

I need an example of how to pull an order's information, say between two dates, and echo it for the customer.
Like between 2016-05-01, and 2016-05-10.

I'm planning on putting this script in a sub-folder called /custom-exports/

The simple output I'm looking for should be something like this:

  Date: 2016-05-03 17:12:22
  Order: 1
  First Name: Jesse
  Last Name: Gangi
  Address 1: 101 Main St
  Address 2:
  City: Duluth
  State: Minnesota
  Zip: 55816
  Email: jgangi@aerialapps.com

Any, and all help is much appreciated, as I can't really grasp how to get this data in Magento 2 versus Magento 1.

If I can understand this, then I can branch it off for customers, and products.


texts: How can I call a CMS Block in a product view page under a individual manufacturer In magento 1.9

texts:
I want to show a promotional banner in all product detail page of a  particular  Brand
Example: Suppose we have Nike , Adidas And puma shoes in a store,
Now i want a  show banner of a Nike  in all  individual Nike shoes product detail  pages  ONLY not in adidas or puma
Thank you


texts: Refused to apply style "because its MIME type ('text/html') is not a supported stylesheet MIME type"

texts:
Suddenly CSS is not loading on my Magento 2 admin panel. The frontend is working fine.

Error details:

1.  "Refused to apply style from 'https://www.ornativa.com/pub/static/version1502029409/adminhtml/Magento/backend/en_US/css/styles-old...' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

2 ."Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at callback ((index):68)
at Object.execCb (require.js:1650)
at Module.check (require.js:866)
at Module.<anonymous> (require.js:1113)
at require.js:132
at require.js:1156
at each (require.js:57)
at Module.emit (require.js:1155)
at Module.check (require.js:917)"


texts:
I'm trying to setup a customized cart rule, so that when an item in the shopping cart has subscriptions enabled, that particular product has free shipping.

I'm new to Magento and managed to modify the rules management in the admin panel to add the "is_subscription_enable" rule by extending the conditions model.

What I haven't found yet, is where exactly does Magento processes and applies the shopping cart rules. Is it when items get added to the shopping cart? When building the checkout page? or is every rule applied individually and it modifies the product properties every time a new rules is added, modified or deleted?

What would be the best approach to achieve this task?


texts: magento 2 round the price by considering decimal points

texts: i want to round my price like AED67.58 to AED67.6 then to AED68. that means i want to remove the decimals by considering valuable decimals.


texts: Magento2 - Programatically Increase/Decrease product price by certain amount for all products

texts:
I need to update(increase/decrease) the price & special price by certain amount or percentage for all products in all stores.

Here is the my code but its not increase/decrease the price. I have also refered few links but not match with the needs.

<?php

error_reporting(1);
ini_set('max_execution_time', 0);
use \Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$state = $objectManager->get('\Magento\Framework\App\State');
$state->setAreaCode('frontend');

$updateprice = "100";

$productFactory = $objectManager->get('\Magento\Catalog\Model\ProductFactory');
$product = $productFactory->create()->load();
$product->setPrice($updateprice);
$product->save();
?>

My version is Magento 2.2.4

Can anyone let me know how to increase/decrease the price for all products?


texts:
my new generated product thumbnails have a black instead of a white background, but i dind't change anything. How can i change settings like that? i tried settings the background image with the helper function but that didn't help...

Mage::helper('catalog/image')->init($product, 'thumbnail', $image->getFile())->backgroundColor(255, 255, 255)->resize(400)

EDIT

It is very confusing... The Problem doesn't exist on any image. I attached two images of a product. The 1st image gets a white and the 2nd a black background. Here's my source code to receive the thumbnails in the template /catalog/product/view/media.phtml:

foreach ($this->getGalleryImages() as $_image) { $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(301); }

If i add a background color of red like the following, only the 1st image will get that. The 2nd image is  still black.

$this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->backgroundColor(array(255, 0, 0))->resize(301);

The magento version is 1.8.1. I tried that images in a magento installation with the version 1.9.1 where the problem doesn't exist...

Thanks for any help!


texts: During checkout, button "continue" doesn't work

texts:
I have a problem on the magento ecommerce that I am creating. When I procede to checkout in the "billing information" section, the button "continue" after I insert user personal data doesn't work. It also doesn't work if I try to procede with a registered user.

Here is the link to the test website:

http://shop.overland.org/mshop/magentoboh/index.php

In the system.log file the following error appears:

  2014-07-30T09:47:26+00:00 ERR (3): Warning:
  include(Mage/Eav/Model/Attribute/Data/.php) [function.include]: failed to open stream:
  No such file or directory  in
  /lib/Varien/Autoload.php
  on line 93

  2014-07-30T09:47:26+00:00 ERR (3): Warning: include() [function.include]: Failed opening
  'Mage/Eav/Model/Attribute/Data/.php' for inclusion
  (include_path='/app/code/local:/app/code/community:/app/code/core:/lib:.:/usr/local/php53/pear')
  in
  /lib/Varien/Autoload.php
  on line 93

I tried researching a bit and as suggested by someone I already attempted replacing the Autoload.php file. The error persists though. The system requirements are met. I have magento 1.8.1.0. Anyone can help?

Thank you very much.

Edit 1: I uploaded a screen with the database result following Dave's comment.

Edit 2: I don't know if it's related to this problem but another error pops up in the error log.

  ERR (3): Notice: Undefined index: customer_group_id  in /app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php on line 1778


texts: How to send custom emails to subscribers in Magento admin section?

texts: I am newbie to Magento development. I am struggling to find out the mailing section for sending custom mails [eg: Offer mails] to subcribers in Magento admin panel. Can anyone tell me how to send custom emails to subcribers in magento admin side ?


texts: Website not loading properly on first visit

texts:
I developed a website on magento 2.2.2 (CE) which is running on managed cloud hosting.

link to website : https://i-ranu.com

all was going good but all of sudden am facing a wierd issue, that website does not load properly on first visit and slider and other product carousel don't load, but after reloading the same all works fine.

Please, any sort of help will be appreciated.


texts: Magento 1 : HEADERS ALREADY SENT (Systemlog)

texts:
DEBUG (7): HEADERS ALREADY SENT: <pre>[0] Root/SITE/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] Root/SITE/lib/Zend/Controller/Response/Abstract.php:768
[2] Root/SITE/app/code/core/Mage/Core/Controller/Response/Http.php:84
[3] Root/SITE/app/code/core/Mage/Core/Controller/Varien/Front.php:184
[4] Root/SITE/app/code/core/Mage/Core/Model/App.php:365
[5] Root/SITE/app/Mage.php:684
[6] Root/SITE/index.php:83
\</pre>


texts: Usage 'base_to_global_rate' and 'base_to_order_rate'

texts:
What is the difference between 'base_to_global_rate' and 'bast_to_order_rate' in an order. When are these fields used?

 $data = Mage::getModel('sales/order')->loadByIncrementId(1000023)->getData();
 var_dump($data);

The dump of the order shows following output:

array (size=145)
  ...
  'base_shipping_tax_amount' => string '0.6500' (length=6)
  'base_shipping_tax_refunded' => string '0.1666' (length=6)
  'base_subtotal' => string '349.5833' (length=8)
  'base_subtotal_canceled' => null
  'base_subtotal_invoiced' => string '349.5833' (length=8)
  'base_subtotal_refunded' => string '333.0000' (length=8)
  'base_tax_amount' => string '68.9000' (length=7)
  'base_tax_canceled' => null
  'base_tax_invoiced' => string '68.9000' (length=7)
  'base_tax_refunded' => string '65.1789' (length=7)
  'base_to_global_rate' => string '1.0000' (length=6)   // <-------
  'base_to_order_rate' => string '1.0000' (length=6)    // <-------
  'base_total_canceled' => null
  'base_total_invoiced' => string '413.3999' (length=8)
  'base_total_invoiced_cost' => string '0.0000' (length=6)
  'base_total_offline_refunded' => string '402.0741' (length=8)
  'base_total_online_refunded' => null
  'base_total_paid' => string '413.3999' (length=8)
  ...


texts: Magento upgrade best practices - moving from dev to production

texts:
I see very little existing posts ANYWHERE about best practices for managing upgrades so I'm hoping this helps me and others.

I have 2 Magento Environments:

Production/Live: Running 1.7.0.0
Development: Copy of Production which I have on a separate clone of the production server.

I wish to upgrade my production site to 1.9.2.0 so this is what I've done so far.

Upgrade development instance: I've followed Magento best practices for conducting an upgrade as per here
http://devdocs.magento.com/guides/m1x/install/installing_upgrade_details.html
As part of the development upgrade I'm tracking all changes on dev via git so I have full file version history on dev now.
At this point I'm now happy that Dev is stable and I'm ready to upgrade production.

Here's the point I'm stuck on. What I've typically seen on any posts/tutorials related to this is that I should rinse and repeat the steps I've taken on dev again on production. Well that would be fine if it hadn't taken me a week to update the dev environment! If I need to go through the same process again in production it will involve a lot of downtime that I can't afford.

So what I was thinking of doing was the following:

Backup live - (filesystem and DB)
Move a copy of the dev file system over to production (separate web root)
Hook up a copy of the live DB to the dev codebase on production
Load live url - I'm hoping this will upgrade the production DB to 1.9.2.0
Copy /media from backup of live
Tweak a few settings in Admin that I would have previously setup on dev

Does anyone foresee any issues with this approach? It will mean not having to manually tweak the live codebase to match the steps taken on dev which will dramatically shorten the downtime required for the switchover.

Any thoughts on this greatly appreciated.

As part of my tasks on dev I maintained a changelog as there were quite a lot of small tweaks required to the source of my theme to ensure it worked correctly with 1.9.2.0.


texts: Validate a Specific Product during add to cart process

texts: How can I create a validation during the add to cart process and return it to the same page with an error message if the validation fails?


texts: Type Error occurred when creating object: Magento\Braintree\Block\Paypal\Button in magento2 braintree

texts:
I override the braintree module after that I'm getting this error. can anyone help me.

Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Braintree\Block\Paypal\Button


texts: How can sync contacts and subscribers in Magento 2 with SendGrid? Any suggestions please

texts:
I have a website on Magento 2 and I need sync all my contacts from Magento 2 to SendGrid. Track all new subscriptions, unsubscriptions from SendGrid and Magento. Also I need see and manage all Sendgrid marketing campaigns in my magento admin panel.

Maybe someone know any good solution for this? I found the official extension from SendGrid company for magento 2, but it's only with SMTP features :(

Thanks for the help!


texts: Magento 2 - Can't install Magento, setup installation process does not even start

texts:
Trygin to install Magento but the setup wizard only shows this:

The error logs shows stuff like:

2017-01-24 17:25:02 Error   IP  500 GET /setup/index.php/landing-installer HTTP/1.1
2017-01-24 17:25:00 Error   IP  404 GET /setup/pub/angular-sanitize/angular-sanitize.min.js.map HTTP/1.1
2017-01-24 17:25:00 Error   IP  404 GET /setup/pub/angular-clickout/angular-clickout.min.js.map HTTP/1.1

Does my Magento-CE-2_1_3.zip  is missing some files?

Composer is installed and had ran the composer install, says nothing to update

All PHP necessary extensiones are enabled

PHP is running on 7.0.9 on FPM, tried also FastCGI

Memory limit is 2048M

Ran this command to fix permissions:

sudo find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \; && sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \; && sudo chown -R :psacln . && sudo chmod u+x bin/magento


texts: which observer to call while removing item from cart and empty cart?

texts: I want to get the product SKU while removing it from the cart or when emptying the cart.


texts: How Can I Edit Order Without Create As New Order

texts: I need to edit order without create same order as new order. How can i do edit order without create as a duplicate.


texts:
I am using Magento 2.0.11. I would like to use the RESTful API

(HTTP:// magento2URL/index.php/rest/V1/categories/(category ID))

to change the "Is Active" attribute of one category from True to False.

The JSON packet I am sending is as following:

{"category": {"id":399,"parentId": 2,"name": "PRIMADONA","isActive": false,"position": 0,"includeInMenu": false}

and I also tried:

{"category": {"id":399,"parentId": 2,"name": "PRIMADONA","is_active": false,"position": 0,"include_in_menu": false}

The magento backend responded http 200 OK but the is_active is not updated:

  < HTTP/1.1 200 OK <
  * Closing connection #0 {"id":399,"parent_id":2,"name":"PRIMADONA","is_active":true,"position":0,"level":2,"children":"","updated_at":"2017-08-04
  08:38:......................>

I also tried adding "all" into the RESTful URL:

(magento2URL/index.php/rest/all/V1/categories/<category ID>)

But none of the above methods are working for me.

Is there any workaround to update the "Is Active" attribute of one category?


texts: PK_CMS_PAGE error when trying to create new category

texts:
I need help please. I got this error when trying to create new category.

  PK_CMS_PAGE in
  /var/www/html/PJ/vendor/magento/framework/EntityManager/EntityMetadata.php

it was working fine on the other machine .


texts:
Im working on a sports e shop and some shoes belong to specific techs which i would like to be shown as images

like this:

I thought of creating a multi select attribute named techs and put values as shown below and create for each option a seperate cms block so that i would call many of these simultanously

View.phtml

<?php /* @var $this Mage_Catalog_Block_Product_View_Abstract */?>
<?php $_product = $this->getProduct() ?>

<?php echo $this->getChildHtml('product_type_data_extra') ?>
<?php echo $this->getPriceHtml($_product) ?>
<?php if ($this->displayProductStockStatus()): ?>
    <?php if ($_product->isAvailable()): ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('In stock') ?>

    <?php else: ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('Out of stock') ?>

    <?php endif; ?>
<?php endif; ?>

<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct()
?>

<?php if ($_product->getAttributeText('tech') == "Pulsor"): ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('tech_pulsor')->toHtml() ?>

<?php elseif ($_product->getAttributeText('tech') == "Flexo"): ?>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('tech_flexo')->toHtml() ?>
<?php endif; ?>

However when i put 2 cms nothing is shown if i put one its ok


texts: Magento 2 Disable Cache for Dynamic Navigation Item

texts:
I made an extension that adds an item to the header navigation if you are within a certain user group.   However, because of caching, it wont always show after logging in and wont always go away if you log out.

Is there a way around this?   I could disable caching for the block I think but it would cause the page itself to not cache and being that its on every page that would slow down the site dramatically.


texts:
I want Magento API Integration but this issue appeared :

  oauth token not generate.

please help

hostname=http://www.fast-option.com/low/magento/admin/
callbackurl=http://www.fast-option.com/low/magento/category_tree.php

user=admin
pass=saudi@123


texts:
Hello i'm newbie with Magento 2, I'm integrating visa-checkout button in checkout of magento

Image is printed but i getting an error about Refused to load the image because it violates the following Content Security Policy directive

  "img-src 'self' data: *.visa.com *.doubleclick.net cdn.betrad.com
  l.betrad.com www.google-analytics.com www.google.com maps.gstatic.com
  cdn.optimizely.com www.staticv.me".

I'm trying to add meta tag in layout

  checkout_index_index.xml

but the same error appears, also i am trying uploading in SSL server but is the same.

This is the error outputed in checkout

Anyone have any idea to integrate Visa-checkout in Magento 2?


texts: Custom extension's custom menu item not showing up on one server

texts:
I am trying to install a custom extension I have made which adds a new menu item to the admin menu so you can navigate to the extension.

I have a localhost server which I have been using to develop and test the extension, and on my local server the menu item appears and works with no problem.
On my localhost I have tested Magento versions:

1.9.2.0
1.9.1.1
1.6.2.0

However when I install the extension on my remote server, the menu item does not appear.
I have tested the following Magento versions on my remote server with the same problem on both:

1.9.2.0
1.9.1.1

Notes

All of my Magento installations on localhost and my remote server were fresh downloads, using a new database for each.
I am installing the module on each installation using the same packaged extension file.
I followed the installation instructions and set the appropriate folder & file permissions on all installations.
I have cleared all caches, both through the admin menu, and by manually deleting the /var/cache/ contents.
An ACL for the custom menu item is not appearing if I view Roles > Permissions on the remote servers either.
I have refreshed my session by logging out and back in on both. I have also tried saving the Roles > Permissions page and then refreshing the session and cache with no effect.
When I install the package through the Magento Connect page, it says that the installation was successful and I can see the extension listed on that page. (On both localhost and remote.)

What could be causing this problem? Everything seems to indicate that this is an issue specific to my remote server, but how can I debug this further and get to the bottom of the issue?

If anyone has experienced this problem before, and/or can put me in the right direction to debug further then I would be most appreciative.


texts: Edit error message content 'This is a required field'

texts:
I'm looking to change the error messages display. I want replace with custom content of default error message i.e. 'This is a required field'.

Example;

Configurable Product: It returns the error message 'This is a required field' if add-to-cart button is clicked without an required attribute selected. I'd like it to return my custom message for all fields like ''Please select a {attribute_label}'. This way it will show, 'Please select a size' or 'Please select a color'.

Same for all fields like email and phone etc.

Please help me to understand if these error messages are called from a translation/language file or if each field has its own error message associated with itself.


texts: Magento-2 : How to set admin form data by join tables

texts:
I have a custom admin module which store customer related data. My custom table created foreign key with customer_id.

I displayed customer name, email in my module grid by join query, It's working but how to set data to edit action by join query.

Thanks


texts: SWAGGER: Parser error on line 27 end of the stream or a document separator is expected

texts:
When i try to get the API schema from swagger for an actuve customer y get this error
Parser error on line 27 end of the stream or a document separator is expected
https://magento.farmagsa.com.ar/swagger
And the customer TEST key is:
f5s39z4o1zcdzpr7auorhl5fltqwkfpe


texts: Magento 2 Get Sales Representative name who placed the order in Order View Page

texts:
I want to add Sales Representative name in Order View page and Invoice PDF for the orders placed via Admin.
For the same I need to add a column to order table which will have the admin name.

After searching over internet I have figured out some points to note:

The correct observer to capture the data when the admin creates a new order is adminhtml_sales_order_create_process_data.

I do not want this observer to be triggered when frontend orders are placed. (Only admin backend created orders). For the same I will place my event observer code into the <adminhtml> node in my module's config.xml file instead of <global>.

However I want to know the process how I can add column to the table.


texts: Magento get list of sales/revenue per brand/manufacturer

texts:
How can one get a quick list of sales/revenue per brand/manufacturer in Magento?

Something like

Brand    Sales (minus returned/cancel)
brand 1  100 euro
brand 2  200 euro

Difficulty I see is: grouping by a product attribute. Correcting for returned and cancelled. And one could add a filter over time (from date - to date)

Any help appreciated


texts: Redirect to another page from CategoryController/View Action (Extended) takes long time?

texts:
I'm writing a dynamic redirect code that is when the url contains the parameter p (i.e. p=1),

Ex: http://www.example.com/category?p=1

Redirects to the below,

Ex: http://www.example.com/category

I have my code in the Category Controller (Extended)'s view action,

The code I have is that as follows,

include_once 'Mage/Catalog/controllers/CategoryController.php';
class MT_Filter_Catalog_CategoryController extends Mage_Catalog_CategoryController{

  public function viewAction(){

  $category = $this->_initCatagory();
  $CategoryUrlKey = $category->getUrl();
  $PageNum = $this->getRequest()->getParam('p');

    if($PageNum==1){

        $this->_redirectUrl($CategoryUrlKey);

    }
    //Other Codes Here

  }
}

What am I missing?
Why It takes long time?


texts: Add more filters in report the products ordered

texts:
Here I am giving my first steps in magento.

And I came across a nescessidade

in: Reports-> Products-> Products ordered

Has the following filters:

Would add a new filter, such as that in: Reports-> Sales-> Orders

Is that possible?
If yes, could someone give me some help? I did a search for extension or someone with similar problems but not getting suceso, I'll be grateful for any guidance.

Thank you for your attention.


texts: Upgrade fails from 2.1.8 to 2.2.1 (Unable to unserialize value, string is corrupted.)

texts:
I hope that some of you can give a tip(s), which will lead me for a solution.

Error converting field additional_information in table ma2_sales_payment_transaction where transaction_id=4 using Magento\Framework\DB\DataConverter\SerializedToJson.
Fix data or replace with a valid value.
Failure reason: 'Unable to unserialized value, string is corrupted.'

What should I fix and from where??


texts: Need to override Catalog twice because of different themes

texts:
My problem is that I have a Magento Enterprise Edition system and 4 different stores on it, so I have 4 different themes. One of those themes override Catalog and Checkout block on Mage/Code/Community folder and another theme override the same blocks on Mage/Code/local folder.

The system is taking by default the Catalog and Checkout blocks from Community folder, so the rest of the websites are taking this version of Catalog and Checkout by default, therefore, those websites aren't working well as they need the original version of those blocks.

Can anyone help me fixing this? I hope can be a way to "override" those blocks on each theme of something similar... I guess I'm not the first person with this problem but I didn't found any solution so far. Please, any help will be appreciated.

Thanks


texts: Load additional product attributes in Wishlist

texts:
I want to show some additional product attributes in the wishlist template, but they are not loaded. On the category page it is working, so it is not an index problem.

When I call

$item->getProduct()

I see that the product has already been loaded, but not with all attributes, so obviously it is coming from a collection.

The wishlist items are coming from Magento\Wishlist\Block\Customer\Wishlist::getWishlistItems() and are passed around in the templates. But where are the products loaded and how can I specify which attributes I need?

I can force a reload, and it would work:

$item->getProduct()->load($item->getProduct()->getId()))

But obviously this is not the right way.


texts: How to detect iphone mobile using prototype.js

texts:
I want separate css file for iphone and another css for other mobile device.
And Use the iphone.css if iphone is detected or responsive.css if other mobile device is detected using prototype.js.
How can I do that. Please help.


texts: SIgnin and signout need on different location in magento2

texts: How to move signin and logout as per image in  magento2


texts: How to re-collect quote totals in Magento 2?

texts:
I'm developing a payment module called Payment fee, when choosing this payment, customer will pay a fee (Surcharge fee)? I think we need to use Ajax to re-calculate. I know how to build a offline payment. But when customer select this payment, I want to re-calculate the total?

There is a guide- how to add fee to order totals in magento2: how to add fee to order totals in magento2. But I don't know how to apply in this case.


texts: How to populate all custom options of a configurable product in product view?

texts:
I have a configurable product in magento which has a size and color as product options. But the colors options gets populated when I have selected a size.
Now I want to populate size and color before any options are selected.

$j("#attribute1051")[0].selectedIndex = 1;
$j( "#attribute1051" ).change();

I have tried to change values in configurable.js or tried to select a value through js, but then the config settings do not get reloaded.

Can somebody help me?


texts: Add Basic HTTP Auth on the entire site hosted on Nginx

texts:
During development, I would like to block access to the entire site. I created a .htpasswd file and I can't work out where to add the following two lines:
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;

Any tip is much appreciated!


texts: How to position the custom tab in customer edit page in admin panel - Magento 2

texts:
I created a custom tab in customer edit page in admin panel. It works perfectly, but I want to position the tab, so I tried to edit the customer_index_edit.xml file like below by adding:

<action method="addTabAfter">
    <argument name="after" xsi:type="string">wishlist</argument>
</action>

but it's not working and throwing an error:

  [2017-10-09 05:56:42] main.CRITICAL: Invalid method vendor\module\Block\Adminhtml\Edit\Tab\Rewardpoints::addTabAfter

My customer_index_edit.xml file is below.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="customer_form">
         <block class="Vendor\Module\Block\Adminhtml\Edit\Tab\Rewardpoints" name="customer_edit_tab_rewardpoints">
            <action method="addTabAfter">
                 <argument name="after" xsi:type="string">wishlist</argument>
            </action>
         </block>
    </referenceBlock>
</body>
</page>

How to position the tab after wishlist tab in customer edit page in admin panel?


texts:
I had these blocks in the frontend layout:

<referenceContainer name="content">
    <block class="Dfl\Marketplace\Block\Profile" name="marketplace_sellerprofile" template="profile.phtml" cacheable="false" before="-"/>
</referenceContainer>
<referenceContainer name="sidebar.main">
    <block class="Dfl\Marketplace\Block\Profile" name="marketplace_sellerprofileleft" template="profile_left_sidebar.phtml" cacheable="false" before="-"/>
</referenceContainer>
<referenceContainer name="sidebar.additional">
    <block class="Dfl\Marketplace\Block\Profile" name="marketplace_sellerprofileright" template="profile_right_sidebar.phtml" cacheable="false" before="-"/>
</referenceContainer>

then i wanted to add a new block in order to insert it in the section. I added the following command above these blocks

<referenceBlock name="head.additional">
  <block class="Dfl\Marketplace\Block\Profile" name="marketplace_social_tags" template="social_tags.phtml" />
</referenceBlock>

then in my social_tags.phtml template I just added a simple meta entry.

Then I run setup:upgrade and setup:static-content:deploy en_US es_ES But the entry wasn't there in the head tag. I followed these links yet i was unable to display the meta entries.

Adding blocks to the head section in Magento 2

magento-2-adding-arbitrary-html-to-the-head-of-every-page

Any help? What it's missing?


texts: How do i add custom class to "Create account " header link and how to rename it label as "Open an Account" in magento 2

texts:
How do I add a custom class to "Create account "  header link

and how to rename it label as "Open an Account" in Magento 2

Please refer the attachments

Can anyone guide me to resolve this issue?


texts: Change onClick to onLoad? Displaying products automatically

texts:
I'm using the b2b order list extension which changes the way products are displayed (in this example I'm using grouped products)...

By default you have to click a link for the simple products to become visible, the links is...

<a href="#" id="openproducts" onclick="getProductOptions(this); return false;">

that triggers the following function;

    function getProductOptions(link){
        jQuery(link).parents("tr").next("tr").find('.complex-product-children').find("select").each(function(){
            if(jQuery(this).hasClass('required-entry-b2borderlist')){
                jQuery(this).removeClass('required-entry-b2borderlist').addClass('required-entry');
            }
        })

        jQuery(link).parents("tr").next("tr").find('.complex-product-children').find("input[type='radio']").each(function(){
            if(jQuery(this).hasClass('validate-one-required-by-name-b2borderlist')){
                jQuery(this).removeClass('validate-one-required-by-name-b2borderlist').addClass('validate-one-required-by-name');
            }
        })

        jQuery(link).parents("tr").next("tr").find('.complex-product-children').find("input[type='checkbox']").each(function(){
            if(jQuery(this).hasClass('validate-one-required-by-name-b2borderlist')){
                jQuery(this).removeClass('validate-one-required-by-name-b2borderlist').addClass('validate-one-required-by-name');
            }
        })
        jQuery(link).parents("tr").next("tr").find('.complex-product-children').show();
    }

Is there any way for me to make it so the link doesn't need to be clicked and its automatically open? I tried doing a trigger click like this;

jQuery(document).ready(function(){
 jQuery("#openproducts").trigger('click');
});

Which works but only for the first product?

Thanks in advance


texts: How to get list of products from last order and generate JSON object

texts:
I have the following code that is inserted in the head tag of the success.phtml

the json generated is like this:
as you can see order is is populated but the product list is not populated, I cant find out the reason

http://screencast.com/t/9aXNdGDOR

<?php

class ThePrinterDepo_Commissionjunction_Helper_Data extends Mage_Core_Helper_Abstract
{
    /**
     * Get SKU, quantity, price and discount amount for each product in a given order
     * @param object $order
     * @return array
     */
    private function _getOrderProductsList($order)
    {
        $orderItems = $order->getAllItems();
        $purchasedSkus = array();
        $count_orderItems = count($orderItems);
        for($i = 0; $i < $count_orderItems; $i++) {
            $purchasedSkus[$i] = array(
                'ITEM' => $orderItems[$i]['sku'],
                'QTY' => number_format($orderItems[$i]['qty_ordered'],0), // no decimals
                'AMT' => number_format($orderItems[$i]['price'],2), // 2 decimal places
                'DCNT' => number_format(abs($orderItems[$i]['discount_amount']),2)
            );
        }

        return $purchasedSkus;
    }

     /**
     * Get the Universal Data (JSON) Object for Commission Junction.
     * This object contains the order details passed on to Commission Junction for reporting purposes
     * on the Checkout Success / Order Confirmation page.
     * Notes:
     *  - CID, TYPE AND CURRENCY are hard coded
     * @param string $orderId
     * @return JSON object Universal Data Object for Commission Junction $json_masterTmsUdp
     */
    public function getCommissionJunctionUdo()
    {
        $lastOrderId = Mage::getSingleton('checkout/session')
            ->getLastRealOrderId();

        $orderId = Mage::getModel('sales/order')
            ->loadByIncrementId($lastOrderId)
            ->getEntityId();

        $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
        $udo = array();
        $udo['CID'] = 'XXXX';
        $udo['TYPE'] = 'XXXX';
        $udo['CURRENCY'] = 'USD';
        $udo['OID'] = $orderId;
        $udo['DISCOUNT'] = number_format(abs($order->discount_amount),2);

        $order_coupon_code = $order->coupon_code;
        if(!is_null($order_coupon_code) && !empty($order_coupon_code))
        {
            $udo['COUPON'] = $order_coupon_code;
        }

        $udo['PRODUCTLIST'] = self::_getOrderProductsList($order);

        if(Mage::getModel('core/cookie')->get('aff_commissionjunction') == 'cjafflx')
        {
            $udo['FIRECJ'] = "TRUE";
        }
        else
        {
            $udo['FIRECJ'] = "FALSE";
        }

        $masterTmsUdo['CJ'] = $udo;
        $json_masterTmsUdo = json_encode($masterTmsUdo);

        return $json_masterTmsUdo;

    }
}
?>
55
<script>var MasterTmsUdo = <?php $myObject = new ThePrinterDepo_Commissionjunction_Helper_Data(); echo $myObject->getCommissionJunctionUdo(); ?></script>
<script>/*DO NOT ALTER *** The Printer Depo*/(function(e){var t="1340",n=document,r,i,s={http:"http://cdn.mplxtms.com/s/MasterTMS.min.js",https:"https://secure-cdn.mplxtms.com/s/MasterTMS.min.js"},o=s[/\w+/.exec(window.location.protocol)[0]];i=n.createElement("script"),i.type="text/javascript",i.async=!0,i.src=o+"#"+t,r=n.getElementsByTagName("script")[0],r.parentNode.insertBefore(i,r),i.readyState?i.onreadystatechange=function(){if(i.readyState==="loaded"||i.readyState==="complete")i.onreadystatechange=null}:i.onload=function(){try{e()}catch(t){}}})(function(){});</script>
55


texts:
I have created a new category in backend and fetched products programmatically via override ListProduct block

<preference for="Magento\Catalog\Block\Product\ListProduct" type="Custom\Vendor\Block\Product\ListProduct" />

But I want to show filter on this page too. Can anyone advice me how we can do that.

Thanks


texts: Custom Module (magento 1.9) - Displaying attrbitue in product.info.extrahint

texts:
I'm using the "product.info.extrahint" reference in my module layout to add my block and in the block template i'm calling a product attribute ('pticks') but for some reason its not working.

My module layout

<?xml version="1.0"?>
<layout version="0.1.0">
    <catalog_product_view>
    <reference name="product.info.extrahint">
    <block type="core/template" as="productticks_productticks" template="productticks/productticks.phtml" />
    </reference>
    </catalog_product_view>
</layout>

Module template file

<?php $_helper = Mage::helper('catalog/output'); ?>

<?php echo $_product->getData('pticks');?>

The template is loaded but the attribute will not show. I'm getting the error  Call to a member function getData() on null which i cant understand because this is on the product page and its clearly an object because the same code works fine on view.phtml.

Why will the attribute not load in my template file referenced in product.info.extrahint. What am i missing?


texts: Magento 2 on save configurable product from admin show product in frontend list, indexing removes

texts:
I've got configurable product and simple product associated to it.
when I save configurable in admin it shows in the the product listing but when I reindex e.g
bin/magento indexer:reindexit removes from product listing

What-the-heck is going on I can't find out if this might be a bug or something else. can anyone please help? I appreciate.


texts: Magento2 with Varnish 4 and Nginx as SSL termination ends in mixed content

texts:
I have the following configuration on Debian based on 2 servers:

On main server there are Apache2 and Magento 2 with Redis and Memcached.
On 2nd server there is Varnish which listens on http://example.com:80

Everything works perfectly until I try to use https.

I installed nginx on the 2nd server and configured it to work as SSL termination according to this tutorial.

Now:

http://example.com works because it goes directly to Varnish
https://example.com ends with only text without css/js/images, because of the mixed content error below:

  Error: "Mixed Content: The page at 'https:// example.com/' was loaded
  over HTTPS, but requested an insecure stylesheet
  'http://example.com/pub/static/frontend/Mycompany/Mytheme/en_US/mage/calendar.css'.
  This request has been blocked; the content must be served over HTTPS."

Does it mean that it is not possible to use Magento 2 with Varnish over https?

Any advice?


texts: Ive added the Facebook pixel for Ads and it shows up fine with the catalog of products but how do I get the products to show on the Shop tab in Facebook? Do I need a separate extension for this?


texts: Magento 2 : How to Remove Container Div From CMS Page

texts:
How to remove container block from cms page for particular layout. I have created new layout and apply on cms page but not able to customize it.

Below my custom layout code:

  app/design/frontend/CleverSoft/moza/Magento_Theme

layouts.xml

<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="fullpage">
        <label translate="true">Full Page Layout</label>
    </layout>
</page_layouts>

  app/design/frontend/CleverSoft/moza/Magento_Theme/page_layout

fullpagelayout.xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="1column"/>
</layout>

It is possible to set block outside the main container?


texts: No. of orders placed by customer in order and customer grid

texts:
I want to display the total no. of orders placed by the customer in the order and customer grid. This will help me identify the type of customer.

Grid.php

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());

    $sql ='SELECT COUNT(*)'
    . ' FROM ' . Mage::getSingleton('core/resource')->getTableName('sales/order') . ' AS o, customer_entity AS e'
    . ' WHERE o.customer_id=e.entity_id' ;
    $expr = new Zend_Db_Expr('(' . $sql . ')');
    $collection->getSelect()->from(null, array('orders_count'=>$expr));

    $this->setCollection($collection);
    return parent::_prepareCollection();
}
protected function _prepareColumns()
{
        $this->addColumn('orders_count', array(
        'header'    => Mage::helper('customer')->__('Total No. of Orders'),
        'align'     => 'left',
        'width'     => '40px',
        'index'     => 'orders_count',
        'type'  => 'number',
        'sortable' => true,
    ));
 }

This shows me the total no. of orders placed and not customer wise.

How can I show the no. of orders customer wise in the order as well as customer grid ?


texts: Magento : Paypal Website Payments Standard, redirect issue

texts:
I recently encountered with a weird paypal redirect issue. this issue comes when i select Paypal Website Standard as payment method and place order. here after clicking on Place Order ideally it should have redirect me to paypal's website for payment processing but it gets stuck on domain.com/paypal/standard/redirect/ giving me a blank screen without any error.

If i hit the same URL on other magento site than it gives me these error Fatal error: Call to a member function validate() on a non-object in /public_html/app/code/core/Mage/Paypal/Model/Standard.php on line 137. but for these site case is completely different.

Below is the Action's code and in that these line $this->getResponse()->setBody($this->getLayout()->createBlock('paypal/standard_redirect')->toHtml()); is not getting executed.

   /**
     * When a customer chooses Paypal on Checkout/Payment page
     *
     */
    public function redirectAction()
    {
        $session = Mage::getSingleton('checkout/session');
        $session->setPaypalStandardQuoteId($session->getQuoteId());
        $this->getResponse()->setBody($this->getLayout()->createBlock('paypal/standard_redirect')->toHtml());
        $session->unsQuoteId();
        $session->unsRedirectUrl();
    }

Guys please help.

[EDIT]

if i do below changes than it will work

//Mage_Paypal_StandardController
$this->getResponse()->setBody($this->getLayout()->createBlock('paypal/standard_redirect')->toHtml());
to
$this->getResponse()->setBody($this->getLayout()->createBlock('paypal/standard_redirect')->_toHtml());

//Mage_Paypal_Block_Standard_Redirect
protected function _toHtml()
to
public function _toHtml()

but i dont think it is good to mess with the access modifier of the method.


texts: Magento2 - How to add comment for each item in cart page

texts:
In Magento 2, how to add meta information in cart item (order comment) add in each item quote during add to cart ?

If any one has idea about this let me know.

Thanks.


texts:
I am trying to filter product with custom text. I have create one module Top Searched product. In this module i am adding Top searched keyword like..

1. Shirt
2. jeans
3. Dress

etc.

So in Top Searched module i have list of these keyword. Now i want to filter search result list with these keyword. Also i want to add these to layered navigation.

Let say i am on search result page www.demo.com/?q=women
Now when i will click on dress on left filter section of my Top search keyword list, it will check dress keyword in product title and list all product with matched keyword Dress in product title with ?q=women.

I hope some one help me on this issue.
Thanks,


texts: Magento 2: Action button renderer for row in Grid

texts:
I have a block that prepare a grid.

In this render I want add a button that call to controller to export.

How I can agree this button to call one controller?

Thanks


texts:
Config file:

<?xml version="1.0"?>
<config>
  <modules>
    <Mmymodul_Autocoupon>
      <version>0.1.0</version>
    </Mmymodul_Autocoupon>
  </modules>
  <global>
    <helpers>
      <autocoupon>
        <class>Mmymodul_Autocoupon_Helper</class>
      </autocoupon>
    </helpers>
  <events>
      <sales_order_invoice_pay> <!-- identifier of the event we want to catch -->
        <observers>
          <sales_order_invoice_pay_handler> <!-- identifier of the event handler -->
            <type>model</type> <!-- class method call type; valid are model, object and singleton -->
            <class>Mmymodul_Autocoupon_Model_Observer</class> <!-- observers class alias -->
            <method>capture</method>  <!-- observer's method to be called -->
          </sales_order_invoice_pay_handler>
        </observers>
      </sales_order_invoice_pay>
    </events>
    </global>
</config>

Observer class:

<?php
class Mymodule_Autocoupon_Model_Observer
{
    public function capture(Varien_Event_Observer $observer)
    {
        Mage::log('Test log', null, 'mylog.log', true);

    }
}


texts:
My website's default currency is EUR, as well as the currency it charges and pays VAT (in Netherland).
We do sell in other currencies, especially GBP, but anyway obligated to present the charged VAT in the invoice in EUR, possibly within brackets.
Do you know about an extension that ensures the default currency appearance in the VAT line, no matter which currency the customer chose?


texts:
I'm new to Magento2 API, I'm trying to retrieve credit memo based on order ID, but it seems to fail to retrieve. Any ideas how to get the credit memo data?

$credit_memo = $orderCollection->getCreditmemosCollection();

foreach ($credit_memo->getAllItems() as $item) {
    $result['items'] = $item->getData();
}
print_r($result);die();


texts: Magento 1.9: I want to customize the print order invoice

texts: I want to customize print layout, can anyone tell me the location of this file. the layout is broken. Thanks


texts: How to add language switcher to top links?

texts:
I'm looking for a way to add the language switcher to my top links menu. My store has 2 languages and I've modified the languages.phtml file to show the alternate language.

Example: if you are on the English site, then the language switcher will show French as a clickable option to bring you to that store view.

I know that in order to add options to the top links menu, you need to modify the customer.xml file. I know how to add alternate links as I've read plenty of "how to's" however none cover how to add the language bar.

Here is the modifications to
languages.phtml

<?php if(count($this->getStores())>1): ?>

<?php foreach ($this->getStores() as $_lang): ?>
    <?php if($_lang->getId() != $this->getCurrentStoreId()): ?>

<a href="<?php echo $_lang->getCurrentUrl(false) ?>"<?php echo $_selected; ?>><?php echo $this->htmlEscape($_lang->getName()) ?>

    <?php endif; ?>
<?php endforeach; ?>

The end result should be:

Login | My Cart | Compare | Wish List | LANGUAGE

How can I add the language bar to the top links menu items?

UPDATE

I've tried adding the following to the customer.xml file under :

<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>

Nothing appears.


texts: What type of concerns should I have when considering the full page cache in module development?

texts:
I'm creating a module with blocks that will be displayed on the category page in Enterprise 1.12.

I'm trying to wrap my head around the full page cache and what needs to be done to implement my module to make use of it.   Is it enough to just have the block extend core/template and have that output go into the full page cache in magento or is my thinking wrong on this?

Thanks in advance!


texts: in magento2 how catalog_product_entity_media_gallery related to catalog_product_entity?

texts:
I am debugging magmi-m2 plugin for image importing and noticed SQL query like this :

    SELECT catalog_product_entity_media_gallery.value_id
    FROM catalog_product_entity_media_gallery
    JOIN catalog_product_entity_varchar ON catalog_product_entity_media_gallery.entity_id=catalog_product_entity_varchar.entity_id
    AND catalog_product_entity_media_gallery.value=catalog_product_entity_varchar.value
    AND catalog_product_entity_varchar.attribute_id=?
    WHERE catalog_product_entity_media_gallery.entity_id=?
      AND catalog_product_entity_varchar.store_id=?

But there is no table column catalog_product_entity_media_gallery.entity_id, how does table catalog_product_entity_media_gallery related to specific product ?


texts: Exporting customer data from xtcmodified to Magento?

texts:
I searched the net but found no real solution. Is there an easy way to export xtcmodified customer data into Magento?

Thanks a lot!


texts: Invalid Signature - add a product using Magento REST API

texts:
i have created AccessToken and AccessTokenSecret as mentioned in the Oauth Rest API Documentation and I am able to retrieve the products using GET Request. But when i try to Create a new product (POST Request) using Java, I am always getting "signature_invalid"  from magento server.

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

Here is the Request:

OAuth oauth_nonce="1332732890", oauth_version="1.0", oauth_consumer_key="402ce3406b6d69b74fe7a4b8652bcec1", oauth_signature_method="HMAC-SHA1", oauth_token="f12bbd4012d11f754c1aee4e372ff1db", oauth_timestamp="1402981865", oauth_signature="C6HSsBXzVJ6YahcX3rNzdXlyZuA="

Thanks in advance.


texts: how to get advance search block on home page magento 2

texts: How can i get advance search block on home page magento 2. i want to show specific attributes in drop-down on home page.


texts: What Database Tables Contain Credit Card Information?

texts:
I have a Magento 1 database that I want to remove sensitive data from before I allow a consultant to connect to.

What tables/rows would I need to fill with dummy data? I have looked at my tables with myPHPAdmin and wasn't able to find one containing credit card information. I read somewhere that not all versions of Magento store credit card information.

Once I find the tables/columns to change, I assume that what I need is something along the lines of:

UPDATE transactions SET creditCardNum = "4111111111111111";


texts:
is it feasible to install simply one extension, that will have multiple context-mixed apps (payment, content, order, etc.) in it, and each app has its own configuration panel?
Does this make sense from an architectural point of view of an extension?

Thanks


texts:
I have an slider in my home web  with the next and prev button to see the images. If I go to the home, the slider appears with a big height and all the images are displayed in a lot of rows.

However, If I update the page, the slider appears correctly, with a row with only 3-4 little images and the buttons.

What is the problem? There aren't js errors in the firefox or chrome.


texts:
I am currently considering changing my oscommerce store to Magento.
It's a hard decision though, and not sure if its worth it. I just feel that oscommerce might be limiting my growth.

What are your thoughts? (obviously you'll be recommending Magento)
Has any of you had experience with oscommerce and can compare the two?

What should I consider, when making my choice?

I currently have pretty good order volume, but oscommerce lacks some basic functionality and reports, that would require my oscommerce to be rebuilt.


texts: Where to add (int)Mage::app()->getStore()->isCurrentlySecure(),

texts:
I facing issue described Here

I added the code to app/code/core/Mage/Cms/Block/Block.php at line 72:

and into

In app/code/core/Mage/Cms/Block/Widget/Block.php at line 82:

But someone also stated that:

(int)Mage::app()->getStore()->isCurrentlySecure()

Needs to be added in order to solve the issue completely, I just can't figure out in which file and where it needs to be added.

Could someone please help me out?

Thanks in advance.


texts: Retrieve simple product price for configurable product on sales_order_place_before event

texts:
I am using magento 1.9.2

I have configurable product product 'whey'

I want to get price for simple product

I used getPrice(); in sales_order_place_before event

But it is giving me 1196.25 (wrong price)

I want 1595, How can I get it

Please help.

I make this changes in database

ALTER TABLE sales_flat_order_item ADD COLUMN product_mrp DECIMAL(12,4) NULL;
ALTER TABLE sales_flat_invoice_item ADD COLUMN product_mrp DECIMAL(12,4) NULL;
ALTER TABLE sales_flat_shipment_item ADD COLUMN product_mrp DECIMAL(12,4) NULL;

Then in Mage_Sales_Model_Observer

public function saveProductMrpInOrder(Varien_Event_Observer $observer) {
        $order = $observer->getEvent()->getOrder();
        foreach($order->getAllItems() as $item) {
            $price = Mage::getModel('catalog/product')->load($item->getId())->getPrice();
            $item->setProductMrp($price);
            Mage::log("Order placed successfully with getOrder event '$price'");
        }
      return $this;
    }

    public function saveProductMrpInInvoice(Varien_Event_Observer $observer) {
        $invoice = $observer->getEvent()->getInvoice();
        foreach($invoice->getAllItems() as $item) {
            $price = Mage::getModel('catalog/product')->load($item->getProductId())->getPrice();
            $item->setProductMrp($price);
            Mage::log("Order placed successfully with with getInvoice event '$price'");
        }
    }
      return $this;
    }

    public function saveProductMrpInShipment(Varien_Event_Observer $observer)
    {
        $shipment = $observer->getEvent()->getShipment();
        foreach($shipment->getAllItems() as $item) {
            $product = Mage::getModel('catalog/product')->load($item->getProductId());
            $price = $product->getPrice();
            $item->product_mrp = $price;
            Mage::log("Order placed successfully with with getShipment event '$price'");
        }
    }

Then in invoice I am using getProductMrp() to get price


texts: Identifying Orders based upon Frontend or Admin Processing

texts: Is there something in an orders database entry that will tell me if an order was processed by the customer on the frontend of the web site, or if it was processed on the backend by an admin?


texts:
I'm getting a template via:

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

and the block is declared like this:

<block type="page/html_topmenu" name="ajaxCart" as="ajaxCart" template="page/html/ajaxCart.phtml"/>

How can I remove this from our caching system?


texts: What's the Role of CACHE_ID and CACHE_TAG in Magento 2?

texts:
In Model Classes, I have seen this constant, CACHE_ID and CACHE_TAG, I know it is used to store data in the cache.

But how does it actually work. What should be considered while caching and flushing our custom variables?.


texts: Google Analytics not collecting ecommerce session data

texts:
When I go to the Google Analytics ecommerce shopping behavior report for a Magento 2 website, there is not data displayed for:

Sessions with Product Views
Sessions with Add to Basket
Sessions with Check-Out

I can also see that Enhanced E-commerce Reporting is enabled:

And that from Stores > Settings > Configuration > Sales > Google API that Google Analytics is set up:

Not sure what is missing?  Does Google Tag Manager need to be set up, is there a quick way I can check for this on the storefront?


texts: How to use 2 different CSS sheets in M2 that user can choose in admin? Layouts or something else?

texts:
I am trying to create 2 new layouts called "3 column - full width" and "2 column - full width" so the user can choose either of those on any article page instead of having to resort to inline css overrides in the 'content' area.

These two layouts can be based off the M2 empty layout, the problem is, I have created them but my page shows blank after I select them in the layout dropdown.

Here's my code for example:

Magento_Theme/pagelayout/one_column-full_width-layout.xml:

<?xml version="1.0"?>

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container" htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer"/>
    </referenceContainer>
</layout>

Magento_Theme/layouts.xml:

<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="two_column-full_width-layout">
        Two Column - 100% Width
    </layout>
    <layout id="one-column-full_width-layout">
        One Column - 100% Width
    </layout>
</page_layouts>

I am also not sure if I am going beyond the scope of what I need to do. I literally just want to user to be able to switch between two stylesheets.

Thanks for any help. Let me know if I need to clarify.


texts: Add message on Checkout Page in Magento 2

texts:
Already add my custom module to Disable Payment method on the Checkout Page based on Product Attribute in Magento 2

Now I want to show the message to customer on Checkout Page if COD is Inactive by this code. Something like this

  COD is not Available on Product - {Product Name}

app\code\Vendor\DisableCOD\Observer\DisablePaymentMethods.php

<?php
namespace Vendor\DisableCOD\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;
class DisablePaymentMethods implements ObserverInterface
{
    public function __construct(\Psr\Log\LoggerInterface $logger)
    {
        $this->_logger = $logger;
    }
    /**
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $cart = $objectManager->get('\Magento\Checkout\Model\Cart');

        // get cart items
        $items = $cart->getItems();

        // get attribute value of cart items
        foreach ($items as $item)
        {
            $p = $objectManager->get('Magento\Catalog\Model\Product')->load($item['product_id']);
            $attribute = $p->getResource()->getAttribute('cod');

            if ($attribute)
            {
                $attr_value = $attribute ->getFrontend()->getValue($p);
                if($attr_value == 'Yes' || $attr_value == 'yes' || $attr_value == 'YES')
                {
                    if($observer->getEvent()->getMethodInstance()->getCode()=="phoenix_cashondelivery")
                    {
                        $checkResult = $observer->getEvent()->getResult();
                        $checkResult->setData('is_available', false);
                    }
                }

            }
        }
    }
}


texts: Magento 1 How to Hide Empty or Null Attribute in Compare Page

texts:
I've realised there are many answer which actually are technically incorrect because they only are taking into account one product. They remove any attribute that is empty or null even if the second product's attribute is not null or empty.

So I decided to post an answer.


texts: Magento 2: Add to cart button on phtml file inside Magento

texts:
I have a Magento 2.2.9 based website and a cms page created that called in a phtml file.

In that phtml file, I am wanting to have an add to cart button for a specific product. However, clicking the button does not seem to add the item to my cart. I am wondering if anyone could suggest changes tome code get it to work.

        <?php
            $sku ='KACI01';
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $productRepository = $objectManager->get('\Magento\Catalog\Model\ProductRepository');
            $product = $productRepository->get($sku);
            $productid = $product->getId();
            $cartHelper = $this->helper('Magento\Checkout\Helper\Cart');
            $addToCartUrl = $cartHelper->getAddUrl($product);

            $postDataHelper = $this->helper('Magento\Framework\Data\Helper\PostHelper');
            $postData = $postDataHelper->getPostData($block->getAddToCartUrl($product), ['product' => $productid])
        ?>

    <form data-role="tocart-form" action="<?php echo $addToCartUrl; ?>" method="post">
       <?php echo $block->getBlockHtml('formkey')?>
       <button class="action tocart primary" data-post='<?php echo $postData; ?>' type="button" title="Add to Bag">
          Add to Bag
       </button>
    </form>


texts: Get TierPrices on home page/outside product view

texts:
I made a .phtml block which should display the lowest price by the parameter sku

{{block type="core/template" sku="theproductsku" template="getlowestprice.phtml"}}

and the getlowestprice.phtml looks like this

$_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$this->sku);
$price=$prod->getPrice();

While getting price works just fine, getting the tier price like I used in product view doesnt work:

$prices = $this->getTierPrices($_product);

($prices equals NULL)

Is there any workaround to get tier prices outside product view?


texts: Magento 2 Multistore : Disable Customer sharing account between the stores of same website

texts:
I have one website with 3 stores. Is it possible that customers of one stores should not be able to loggin to other 2 stores.
The customer should not share cart between the stores. Is there an extension for this. Please advice.


texts: Multi store view confusion, page 404's redirects and Magento store codes

texts:
I have set up several store views(for different languages), all under the same website and store.

The languages appear nicely, and I can switch between them. I have created several categories and started to localize them. All was going nicely.

The way I have set up the categories was like this(example):
/women (name:"Women", slug:"women")
-->shoes (name "Shoes", slug: "shoes")

And one of it's translations:

/zhen (name:"Zhen", slug:"zhen")
-->obuv (name:"Obuv", slug:"obuv")

I could see my products, categories appear on the website and I could switch between languages using the language switcher.

Now, the problems arose when I noticed that I could only get to see the pages in other languages if I used the language switcher. If I copy pasted a mysite.com/zhen/obuv into an incognito window, it would show me a 404. So in other words, If I sent the link to a person, he would also get the 404. So the only way to see the page in other languages was to use the language switcher(which presumably wrote a cookie to the browser), which would allow to see the localized category/page of the website.

I have checked URL rewrites in the Magento settings, they do look correct, i.e. both of those slugs/url are pointing to the same category(target path).

I have tried everything, emptying the URL rewrite table. Re-indexing, clearing cache, checking and re-checking all setting for store views/categories etc.

Then I've tried to set the "Add Store Code to Urls" to Yes. Which resolved all the problems, but also added a mysite.com**/en/** store codes to every page/store. Now it works more or less ok.

My questions are:
1. Where the URLs not resolving because it is not intended to be used that way(in the case of multi store)? (All things should have the same slug in case that I'm not suing store  codes?)
2. Is it imperative to use store codes (like /en/) when trying to run a multi store view website?

Am I missing something here?


texts:
Cron Job is not working. Below is crontab.xml file:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="index">
        <job instance="Vendor\Module\Cron\Run" method="execute" name="OrdSendMail">
            <schedule>*/5 * * * *</schedule>
        </job>
    </group>
</config>


texts: Magento Products are not listed on frontend

texts:
I downloaded an old magento version 1.5 and installed it on my local server.

My admin panel is working perfect but products are not listed in frontend.

Links are not working on frontend.

I have cleared cache, reindexed data, increased memory_limit.

Nothing is working for me, Any suggestion?


texts: Setting Order Status with Payment Gateway

texts:
I'm a Magento beginner. I'm trying to create a custom offline payment gateway, that will function like a check/money order type gateway. I've got something rough up and working by following this tutorial:

https://www.magestore.com/magento-2-tutorial/2361-2/

As I understand it, this gateway should be putting orders into 'pending_payment' status upon placement. Is see this line in Pendingpayment.php:

class Pendingpayment extends Status
{
/**
* @var string[]
*/
protected $_stateStatuses = [Order::STATE_PENDING_PAYMENT];
}

But when orders are placed with this gateway, they are in the 'processing' status. If I pull the order using the API (mysite/rest/V1/orders/{id}), I see both a state and status of 'processing'.

How can I get this gateway to put orders in 'payment_pending' status until further action?


texts: Magento2 showing default meta description over catalog category meta description

texts:
I'm using magento2.2.5, setting the default meta description from design configuration then setting each catalog category meta description individually, then clearing the cache but the default meta description still displaying in the category page.
Am I missing something?
How to solve this?


texts: Magento2. How to create custom form for email sending in admin GRID form?

texts:
I have items in admin-GRID. When I click on any item I open the form with some information, some of whom are email. I need to implement a custom form with a button "Send" to send email.
What can I do that?


texts: Why Config.xml of Mage/Checkout module not defining helpers?

texts:
I've noticed that in Mage/Checkout module's config.xml,there is not tag defining its helpers but it has three helper classes.

Please let me understand the scenario?


texts: Stopping Elasticsearch service removes category products in 2.4

texts:
I was curious what would happen if I stopped the Elasticsearch service in Magento 2.4. What I found I cant seem to understand.
When the service is stopped it empties all the categories. I would have assumed Elasticsearch was for the mini search/advanced search not the catalog listings.
Can anyone confirm if this is by design or is there a bug in Magento 2.4? Also any ideas on how to fix this?
My setup is Magento 2.4 on Valet (MacOs/PHP 7.3.20). I installed Elasticsearch via Homebrew.
Elasticsearch running

Elasticsearch stopped


texts:
In Magento 2, I trying to get the Product URL using this code $_product->getProductUrl (). But it is having only the first product's url to all the products. How to fix it.

Used the Following Code:

$_collection = $this->objectManager->get ( '\Magento\Catalog\Model\Product' )->getCollection ();
 $_collection = $collection->getData();
 foreach ( $_collection as $_product ) {
 $_product = $this->objectManager->get ( 'Magento\Catalog\Model\Product' )->load ( $_product['entity_id'] );

      echo $product_url = $_product->getProductUrl ();
}


texts: Magento Checkout final step Error --- "Falied to connect : 0"

texts: After patch the 6788 to the magento store(CE,Ver1.9.0.1),At the final stage of checkout(url /checkout/onepage/success/), it always display an error message of "Failed to connect: 0". Even revert that patch can't resolve the problem.Also failed on back to the backup former version or even uninstall all extra extensions. But everything is fine while pull the code to the local stage, Any clue or idea will be highly appreciated, Thanks!


texts: How to get multi-select attribute option in products using REST api?

texts: How to get multi-select attribute type option in products using REST api in Magento 2?


texts:
I'm getting this error while changing stylesheet. This is the only thing that shows up on the screen. How do I begin to debug this? Reverting doesn't do anything. I've tried cache flush and setup upgrade also deleted var/cache/* var/generation/* var/page_cache/* var/view_preprocessed/* generated/* pub/static and rebuilt. Same error

Fatal error: Uncaught TypeError: Argument 1 passed to
Magento\Framework\View\Page\Config\Renderer::canTypeBeFont() must be
of the type string, null given, called in
/chroot/home/a59125d9/domain.com/pub/vendor/magento/framework/View/Page/Config/Renderer.php
on line 360 and defined in
/chroot/home/a59125d9/domain.com/pub/vendor/magento/framework/View/Page/Config/Renderer.php:439
Stack trace: #0
/chroot/home/a59125d9/domain.com/pub/vendor/magento/framework/View/Page/Config/Renderer.php(360):
Magento\Framework\View\Page\Config\Renderer->canTypeBeFont(NULL) #1
/chroot/home/a59125d9/domain.com/pub/vendor/magento/module-developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php(75):
Magento\Framework\View\Page\Config\Renderer->addDefaultAttributes(NULL,
' media="print"') #2
/chroot/home/a59125d9/domain.com/pub/vendor/magento/framework/View/Page/Config/Renderer.php(422):
Magento\Developer\Model\View\Page\Config\ClientSideLessCompilation\Renderer->addDefaultA
in
/chroot/home/a59125d9/domain.com/pub/vendor/magento/framework/View/Page/Config/Renderer.php
on line 439


texts:
I have different sizes of shirts, and with it, different prices.

On the grid it shows the "as low as": R$XX,XX
but also shows the regular price. How can I remove the regular price?

Here is the website so you can see it: http://nerdcamisetas.net.br/


texts: Magento 2: How to make the phone number optional?

texts:
What is the right way to make the phone number not required during the checkout in Magento 2?

I have read different opinions where people suggest editing the database, which as far as I know is not a good practice


texts: Catalog list view is limited to 5 results somehow

texts:
Magento CE 1.7

Working with another developer's masterpiece...

This site previously had a very small category of only 4 products. They are adding 2 for a total of 6. After adding and enabling the two new additions into the category I can only see 5 products. I can change the positioning of products and see all 6 but there is a limit being applied somewhere.

I first checked catalog.xml for a column limit and found none. Then I checked list.phtml looking for setPageSize or collectionSize attributes and still found nothing. The page they are using to display these selected products is a CMS page so I looked at the layout update XML and didn't see anything. I tried applying a layout update:

<action method="setColumnCount"><columns>6</columns></action>

Updated indexes, cleared cache. Nothing.

I echoed the collectionSize on the list.phtml to see what the count was and it continues to say 5. I then did a string search for this mysterious 5 on the entire app directory. Combed through it and did not see a result. Again, the products show if I manipulate product position. I also disabled CSS to see if by chance there was an issue with display:none; or anything of that nature.

I suppose the appropriate question is this: What is the very first location in Magento where someone might place a limit on the number of returned catalog results? Thank you.


texts: How to add toolbar and pager to custom product collection in magento?

texts:
my local/mage/catalog/prodoct/newwall.php

protected function _getProductCollection()
{
   if (is_null($this->_productCollection)) {

      $brand_id = $_GET['brand_id'];
      $collection = Mage::getModel('catalog/product')->getCollection()
                   ->addAttributeToFilter('manufacturer', array('eq' => $brand_id ))
                   ->addAttributeToSelect('*');
      $this->setProductCollection($collection);
    }

      return $collection;

}

I Added cms page layout

 <reference name="content">
   <block type="catalog/product_newall" name="product_new" template="catalog/product/list.phtml">
      <block type="catalog/product_list_toolbar" name="product_list_toolbar"  template="catalog/product /list/toolbar.phtml">
         <block type="page/html_pager" name="product_list_toolbar_pager"/>
      </block>
      <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
   </block>
</reference>

Please tell me How To add default magento toolbar and pager. using this code display only product.


texts: Magento 1.9 the changes in core/Mage/Sales/wsdl.xml not working?

texts: I have changed directly the core sales/wsdl.xml and wsi.xml files to add a custom column value in order_info and order_list of SOAP API V2 but it doesn't appear, Please help me. I am stuck.


texts: Generate coupon automatically with a credit memo?

texts:
Most ecommerces offer to their customers 2 basic options in cases when they wanna return one or more items to the store, for some reason such as wrong size or color, whatever. Those options are: choosing if they prefer either get a coupon in the purchase value or a refund using the same way the customer used to pay an order. In Magento is already possible to make a refund, online or manually, doesn't matter.

So now, I would like to know if would be possible generating a coupon automatically with a credit memo, maybe using a custom status like "voucher issued" and assigned to the "closed" state. I know that already there is some extensions to do that, but I'm not looking for extensions at this first time.

In summary, is it possible to do that programatically? Alternative ways could be help me a lot too.


texts: is there any way to create custom search criteria field (SearchCriteria[filter_groups][0][filters][0][field] )?

texts:
Is there any way to add a custom field in search criteria in Magento 2 REST API.
Custom Field means I want to filter products by using Final Price in V1/products endpoint
Thanks.


texts:
I'm trying code

<?php $models = $this->getModel();  ?> ("getModel() is model slideshowdata")
        <?php if($models -> count() > 0 ): ?>
            <?php foreach($models as $model): ?>
                <?php   $objSlideshow = $this->_objectManager->get("Xanka\Slider\Model\Slideshow")->load($model->getId());?>
...

but not true. Any suggestion ?
I wana getModel slideshow with condition slideshow_id(slidehoswdata) aqua slidesshow_id(slideshow). so how make it ? I use

<?php   $objSlideshow = $this->_objectManager->get("Xanka\Slider\Model\Slideshow")->load($model->getId());?>

but wrong.
thanks


texts:
I want to update each and every image name from product media gallery.

I want to append SKU in product name for example imagename-SKU.jpg

Any Idea how to append all existing images  using extensional php script ?


texts:
I have a Magento 1.9.3.1 website in front of me right now in which the core files have been edited

( THEY HAVE COMMITTED A SIN!!! ).

Anyway I have figured out which files they have edited and I am currently working on removing all those custom lines of code.

However I need to keep the functions which have been added in the website but I don't know what I should do exactly or where to place them.

Is it as simple as placing the files in local or community?
( local = specific for this website. community = from the web and not specifically for this website ).  And does this count for all the files? So right now I've found all the files they edited, these are the files :

  app/code/core/Mage/Catalog/Model/Product/Type/price.php
  app/code/core/Mage/core/model/Email/Template.php
  app/code/core/Mage/Customer/Controllers/AccountController.php
  app/code/core/Mage/Customer/model/Customer.php
  app/code/core/Mage/Customer/model/Session.php
  app/Mage.php

Sadly I do not know if I should simply copy paste the code and add the lines of code in the custom liberary. I did google it though but I keep ending up at theme template posts...

Could you tell me where I should put the new files? and maybe if possible explain it too,
And in case I am doing this completely wrong, please tell me.


texts: A customer without a tax rule is possible?

texts: I have a Tax Zones and Rates for my store (21% per each country) but I have some customers that I need to configure to avoid paying this tax. Is it possible to configure a user to not be assigned this rule?


texts: Magento 2 - Assign product to category on frontend

texts:
I am creating a frontend from for Sellers to add/edit their product on website, product adding/editing is working perfect. Now I have to assign that product to a category

Almost on every article and blog there is one proper solution to assign product to a category:

//Removing previous categories
$previousCategoryIds = $product->getCategoryIds();
foreach($previousCategoryIds as $k=>$previousCategoryId){
    $this->categoryLinkRepository->deleteByIds($previousCategoryId,$product->getSku());
}

//Assigning new categories
$this->categoryLinkManagement->assignProductToCategories($product->getSku(),$categories);

The code is fine, but I am getting this error:

  Fatal error: Uncaught Error: Call to undefined method
  Magento\Catalog\Model\ResourceModel\Category\Flat::saveAttribute() in
  ...vendor/magento/module-catalog-url-rewrite/Observer/CategoryUrlPathAutogeneratorObserver.php:96

I have searched this error and found the cause of this error:
https://github.com/magento/magento2/issues/9725#issuecomment-346621159

The problem is, category link repository and link management is only for backend, and I am trying to use it on frontend scope that's why it is causing this error.

I have also tried this:

$product->setCategoryIds($categories);

But above code appending categories, not replacing previous categories.

Can you help me resolve this issue? I have tried everything I have found.

Edit:

The problem is with flat category, if I enable flat category then error occurs, and if I disable flat category it is working fine.


texts: Magento 2: Extend Magento Customer, add new label and content

texts:
I'm new to magento 2. I'm having problem on creating a new label in the customer dashboard area and add a content with it.

My question is how to create a label with content. How should be the correct process for it. Please correct me if I'm wrong.

Attached is the screenshots for my desired outcome.


texts: Site Header not showing in other pages except Homepage

texts:
My site Header is not showing in other pages except the Homepage

My Header.phtml Code -

(AFL 3.0)
 */
/**
 * @var Mage_Page_Block_Html_Header $this
 */
?>

    <?php if ($this->getIsHomePage()):?>

<?php echo $this->getLogoAlt() ?><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />

    <?php else:?>
    <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><?php echo $this->getLogoAlt() ?><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
    <?php endif?>

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

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

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

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

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

1Column 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() ?>">

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

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

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

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

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

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

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

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


texts:
How it's possible to change the Backorder cart message???

I'd need to display something like "The product will be available to ship from the 1st of january"

Thx


texts:
I want to disable datepicker when clicking on radio button

<input
  type="radio"
  class="shwbtnrd"
  required="required"
  id="bookType"
  name="bookType"
  value="1"
  checked="checked"
  onclick="window.location='<?php echo $_SERVER['REQUEST_URI']; ?>';"
/>

<input
  name="dat"
  id="dat"
  required="required"
  readonly="readonly"
  placeholder="Date of Birth"
  class="form-control"
  type="text"
/>

<script>
$(function () {
  $("#dat").datepicker({
    changeMonth: true,
    changeYear: true,
    yearRange: '-100:+0',
    dateFormat: 'yy-mm-dd',
    maxDate: new Date()
  });
});
</script>

If i click on radio button then need to disable bootstrap datepicker


texts:
I cannot do any more invoices, this error message appears in every order.

Fatal error: Call to a member function getParentItem() on a non-object in /home/design/public_html/app/design/adminhtml/default/default/template/sales/order/invoice/view/items.phtml on line 50

Someone can help me to solve this problem? Thanks.


texts:
I am working on an extension and i want to destroy specific customly created session when the order is placed, not when it's paid, but just when it is created.

Here is my config code:

<global>
.....
<events>
<sales_order_place_after>
    <observers>
        <clear_session>
            <class>PercentPayment_Model_Observer</class>
            <method>clearCheckoutSession</method>
        </clear_session>
    </observers>
    </sales_order_place_after>
</events>
 .....
</global>

And here is my observer: /app/code/local/VivasIndustries/PercentPayment/Model/Observer.php:

<?PHP
class VivasIndustries_PercentPayment_Model_Observer extends Varien_Event_Observer
{

    public function clearCheckoutSession()
    {
        Mage::getSingleton('core/session')->unsPcPayment(); // Or whatever you want to clear
    }

}

Here is my complete config.xml: http://pastebin.com/YEyBJiPY please check it out.

The problem is that the session is not destroyed when the order is created.
Where is my mistake, can you help me out?

Thanks!


texts: How to get Current Module and Full Action Name in ajax controller

texts:
I need Full Action Name in Ajax Controller Magento 2.

protected $request;
public function __construct(
    ...
    \Magento\Framework\App\Request\Http $request
) {

    $this->request = $request;
}

$action = $this->request->getFullActionName();

This always giving me my ajax controller full action name.

I need, suppose if I m on the product page this should give me "catalog_product_view".

If I m on search this should display "catalogsearch_result_index".

Please help.


texts: Checkout - get shipping methods in custom component

texts:
Magento 2.0.1.

I have created custom component in checkout, and I want to get inside its js file list of active shipping methods and preselect one of them, according to configuration passed via custom CheckoutConfigProvider.
My component is placed in shipping step node children array.

Problem is getting shipping method list. Firstly I tried to use as dependency magento2/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-service.js and then use method getShippingRates, which actually is used inside magento2/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js and there it returns shipping methods list. Unfortunately, my js it returns an empty array.

Also, I tried to move my component into children array of shipping adrress node, but it did not help.

In both places, my component js is loaded before shipping.js and returns empty methods array. Has anyone tried to work with shipping methods during checkout loading?


texts:
I need to add additional information to the catalog_category_product table.
This information is to be entered and saved in the category product grid, in a column similar to Position.

Task I've successfully completed so far are:

Added a new column to the catalog_category_product table.
Extended Mage_Adminhtml_Block_Catalog_Category_Tab_Product and added a new column to the grid.

After this I am stuck, any help would be appreciated.

EDIT: Code i've implemented so far which outputs the custom field but doesnt not save information into the field.

File: app/code/local/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php

Function: _prepareCollection

Here i changed joinField to joinTable so I could access all fields in catalog_category_product.

protected function _prepareCollection()
{
    if ($this->getCategory()->getId()) {
        $this->setDefaultFilter(array('in_category'=>1));
    }
    $collection = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('sku')
        ->addAttributeToSelect('price')
        ->addStoreFilter($this->getRequest()->getParam('store'))
        ->joinTable(
            'catalog/category_product',
            'product_id=entity_id',
            ['position' => 'position','custom_field' => 'custom_field'],
            'category_id='.(int) $this->getRequest()->getParam('id', 0),
            'left');

    $this->setCollection($collection);

    if ($this->getCategory()->getProductsReadonly()) {
        $productIds = $this->_getSelectedProducts();
        if (empty($productIds)) {
            $productIds = 0;
        }
        $this->getCollection()->addFieldToFilter('entity_id', array('in'=>$productIds));
    }

    return parent::_prepareCollection();
}

Function: _prepareColumns

Here I added a new column to display my custom field.

    protected function _prepareColumns()
{
    if (!$this->getCategory()->getProductsReadonly()) {
        $this->addColumn('in_category', array(
            'header_css_class' => 'a-center',
            'type'      => 'checkbox',
            'name'      => 'in_category',
            'values'    => $this->_getSelectedProducts(),
            'align'     => 'center',
            'index'     => 'entity_id'
        ));
    }
    $this->addColumn('entity_id', array(
        'header'    => Mage::helper('catalog')->__('ID'),
        'sortable'  => true,
        'width'     => '60',
        'index'     => 'entity_id'
    ));
    $this->addColumn('name', array(
        'header'    => Mage::helper('catalog')->__('Name'),
        'index'     => 'name'
    ));
    $this->addColumn('sku', array(
        'header'    => Mage::helper('catalog')->__('SKU'),
        'width'     => '80',
        'index'     => 'sku'
    ));
    $this->addColumn('price', array(
        'header'    => Mage::helper('catalog')->__('Price'),
        'type'  => 'currency',
        'width'     => '1',
        'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
        'index'     => 'price'
    ));
    $this->addColumn('position', array(
        'header'    => Mage::helper('catalog')->__('Position'),
        'width'     => '1',
        'type'      => 'number',
        'index'     => 'position',
        'editable'  => !$this->getCategory()->getProductsReadonly()
        //'renderer'  => 'adminhtml/widget_grid_column_renderer_input'
    ));

    $this->addColumn('custom_field', array(
        'header'    => Mage::helper('catalog')->__('My Custom Field'),
        'width'     => '1',
        'type'      => 'number',
        'index'     => 'custom_field',
        'editable'  => !$this->getCategory()->getProductsReadonly()
        //'renderer'  => 'adminhtml/widget_grid_column_renderer_input'
    ));

    return parent::_prepareColumns();
}


texts: Problem with the sort by price for configurable and simple products

texts:
i have a problem with the sorting by price in my website http://makemydrink.com/. Since their are many configurable products and simple products, i'm facing a problem in sorting.So i'll be gratefull if somebody helps me.

This is my toolbar.phtml code:

                    <?php echo $this->__('Sort By') ?>
                    <select onchange="setLocation(this.value)" class="sortby" name="sortby">
                    <option value="<?php echo $this->getOrderUrl('price', 'asc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection()=='asc' ): ?> selected="selected"<?php endif; ?>>Price                       </option>
                    </select>

                <?php if($this->getCurrentDirection() == 'asc'): ?>
                    <a href="<?php echo $this->getOrderUrl('price', 'asc') ?>" title="<?php echo $this->__('Set Ascending Direction') ?>"><img src="<?php echo $this->getSkinUrl('images/i_desc_arrow.gif') ?>" alt="<?php echo $this->__('Set Ascending Direction') ?>" class="v-middle" />
                <?php else: ?>
                    <a href="<?php echo $this->getOrderUrl('price', 'desc') ?>" title="<?php echo $this->__('Set Descending Direction') ?>"><img src="<?php echo $this->getSkinUrl('images/i_asc_arrow.gif') ?>" alt="<?php echo $this->__('Set Descending Direction') ?>" class="v-middle" />
                <?php endif; ?>

and i also edited toolbar.php as

$this->_availableOrder = array('price'=>__('Price'));


texts:
I have created new order status "Test" from admin panel.

Status is not showing on sales order.

How can i show status on sales order?